summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorGregor Hartmann <gh@openoffice.org>2002-04-11 07:38:47 +0000
committerGregor Hartmann <gh@openoffice.org>2002-04-11 07:38:47 +0000
commitf0349163e76f0fe21cd0232832c1fa1c2574c7c2 (patch)
tree5f3b7b4f42a49396a293c705a6a92d48c4cf368a /basic
parent62b750dbdc7c9a3206e7b16ff96384a658f36e83 (diff)
#93845#Make font configurable
Diffstat (limited to 'basic')
-rw-r--r--basic/source/app/appedit.cxx44
-rw-r--r--basic/source/app/appedit.hxx5
-rw-r--r--basic/source/app/apperror.cxx27
-rw-r--r--basic/source/app/basic.hrc11
-rw-r--r--basic/source/app/basic.src162
-rw-r--r--basic/source/app/brkpnts.cxx5
-rw-r--r--basic/source/app/dialogs.cxx113
-rw-r--r--basic/source/app/dialogs.hxx38
-rw-r--r--basic/source/app/msgedit.cxx8
-rw-r--r--basic/source/app/resids.hrc14
-rw-r--r--basic/source/app/textedit.cxx10
11 files changed, 383 insertions, 54 deletions
diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx
index 327fa1f96bd3..74a796902c0b 100644
--- a/basic/source/app/appedit.cxx
+++ b/basic/source/app/appedit.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: appedit.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: gh $ $Date: 2001-05-04 10:51:40 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,14 +59,18 @@
*
************************************************************************/
+#ifndef _CONFIG_HXX
+#include <tools/config.hxx>
+#endif
+#ifndef _CTRLTOOL_HXX
+#include <svtools/ctrltool.hxx>
+#endif
#ifndef _TEXTVIEW_HXX //autogen
#include <svtools/textview.hxx>
#endif
-
#ifndef _TEXTENG_HXX //autogen
#include <svtools/texteng.hxx>
#endif
-
#ifndef _UNDO_HXX
#include <svtools/undo.hxx>
#endif
@@ -90,6 +94,7 @@ AppEdit::AppEdit( BasicFrame* pParent )
// evtl. den Untitled-String laden:
pDataEdit = new TextEdit( this, WB_LEFT );
+ LoadIniFile();
// Icon definieren:
// pIcon = new Icon( ResId( RID_WORKICON ) );
// if( pIcon ) SetIcon( *pIcon );
@@ -117,6 +122,37 @@ AppEdit::~AppEdit()
delete pVScroll;
}
+void AppEdit::LoadIniFile()
+{
+ FontList aFontList( pFrame ); // Just some Window is needed
+ Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
+ aConf.SetGroup("Misc");
+ String aFontName = String( aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8 );
+ String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 );
+ String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 );
+ Font aFont = aFontList.Get( aFontName, aFontStyle );
+// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT );
+ ULONG nFontSize = aFontSize.ToInt32();
+// aFont.SetSize( Size( nFontSize, nFontSize ) );
+ aFont.SetHeight( nFontSize );
+
+#ifdef DEBUG
+ {
+ Font aFont( OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, Application::GetSettings().GetUILanguage(), 0, pFrame ));
+ }
+#endif
+ aFont.SetTransparent( FALSE );
+// aFont.SetAlign( ALIGN_BOTTOM );
+// aFont.SetHeight( aFont.GetHeight()+2 );
+ pDataEdit->SetFont( aFont );
+
+ if ( ((TextEdit*)pDataEdit)->GetBreakpointWindow() )
+ {
+ ((TextEdit*)pDataEdit)->GetBreakpointWindow()->SetFont( aFont );
+ ((TextEdit*)pDataEdit)->GetBreakpointWindow()->Invalidate();
+ }
+}
+
void AppEdit::Command( const CommandEvent& rCEvt )
{
switch( rCEvt.GetCommand() ) {
diff --git a/basic/source/app/appedit.hxx b/basic/source/app/appedit.hxx
index aadbbcfe6fd3..0dfa68af3880 100644
--- a/basic/source/app/appedit.hxx
+++ b/basic/source/app/appedit.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: appedit.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: gh $ $Date: 2001-05-04 10:51:40 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,6 +96,7 @@ public:
void Mark( short, short, short );// Text markieren
void Highlight( USHORT nLine, USHORT nCol1, USHORT nCol2 );
virtual BOOL ReloadAllowed(){ return !StarBASIC::IsRunning(); }
+ virtual void LoadIniFile(); // (re)load ini file after change
};
#endif
diff --git a/basic/source/app/apperror.cxx b/basic/source/app/apperror.cxx
index 8317de6bf0e7..88a85268acb6 100644
--- a/basic/source/app/apperror.cxx
+++ b/basic/source/app/apperror.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apperror.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: gh $ $Date: 2002-03-28 14:43:03 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,6 +62,9 @@
#ifndef _SV_CONFIG_HXX
#include <vcl/config.hxx>
#endif
+#ifndef _CTRLTOOL_HXX
+#include <svtools/ctrltool.hxx>
+#endif
#ifndef _BASIC_TTRESHLP_HXX
#include "ttstrhlp.hxx"
#endif
@@ -72,9 +75,10 @@ TYPEINIT1(AppError,AppWin);
AppError::AppError( BasicFrame* pParent, String aFileName )
: AppWin( pParent )
{
- LoadIniFile();
SetText( aFileName ); // Mu vor new MsgEdit stehen!!
pDataEdit = new MsgEdit( this, pParent, WB_HSCROLL | WB_VSCROLL | WB_LEFT );
+ LoadIniFile();
+ bHasFile = pDataEdit->Load( aFileName );
DirEntry aEntry( aFileName );
UpdateFileInfo( HAS_BEEN_LOADED );
// Icon definieren:
@@ -126,4 +130,21 @@ void AppError::LoadIniFile()
aConf.SetGroup("Path");
aBaseDir = DirEntry( aConf.ReadKey("Basisverzeichnis") );
+
+
+ FontList aFontList( pFrame ); // Just some Window is needed
+ aConf.SetGroup("Misc");
+ String aFontName = String( aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8 );
+ String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 );
+ String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 );
+ Font aFont = aFontList.Get( aFontName, aFontStyle );
+// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT );
+ ULONG nFontSize = aFontSize.ToInt32();
+// aFont.SetSize( Size( nFontSize, nFontSize ) );
+ aFont.SetHeight( nFontSize );
+
+ aFont.SetTransparent( FALSE );
+// aFont.SetAlign( ALIGN_BOTTOM );
+// aFont.SetHeight( aFont.GetHeight()+2 );
+ pDataEdit->SetFont( aFont );
}
diff --git a/basic/source/app/basic.hrc b/basic/source/app/basic.hrc
index 2b49303e3c33..c81998e5d4ca 100644
--- a/basic/source/app/basic.hrc
+++ b/basic/source/app/basic.hrc
@@ -2,9 +2,9 @@
*
* $RCSfile: basic.hrc,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -198,9 +198,10 @@
#define IDD_PRINT_DIALOG 4006
#define IDD_OPTIONS_DLG 4007
#define RID_TP_SPECIAL 4008
-#define RID_TP_GENERIC 4009
-#define IDD_DISPLAY_HID 4010
-#define IDD_EDIT_VAR 4010
+#define RID_TP_FONT 4009
+#define RID_TP_GENERIC 4010
+#define IDD_DISPLAY_HID 4011
+#define IDD_EDIT_VAR 4012
//#define RID_APPFONT 5000
diff --git a/basic/source/app/basic.src b/basic/source/app/basic.src
index 4caae1387e07..204af7dc5323 100644
--- a/basic/source/app/basic.src
+++ b/basic/source/app/basic.src
@@ -2,9 +2,9 @@
*
* $RCSfile: basic.src,v $
*
- * $Revision: 1.43 $
+ * $Revision: 1.44 $
*
- * last change: $Author: gh $ $Date: 2002-03-18 15:15:01 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -3226,6 +3226,12 @@ ModelessDialog IDD_OPTIONS_DLG
Text[ catalan ] = "Especialitzat";
Text[ finnish ] = "Erikoinen";
};
+ PageItem
+ {
+ Identifier = RID_TP_FON ;
+ Text = "Schrift" ;
+ Text [ english_us ] = "Font" ;
+ };
};
OKButton RID_OK {
Pos = MAP_APPFONT( 65, 124 );
@@ -3726,13 +3732,14 @@ TabPage RID_TP_SPECIAL {
Text[ catalan ] = "Recrrega automtica";
Text[ finnish ] = "Automaattinen uudelleenlataus";
};
-// Unbenutzt aber Positioniert
-// CheckBox CB_AUTOSAVE {
-// Pos = MAP_APPFONT( 127, 70 );
-// Size = MAP_APPFONT( 103, 12 );
-// Text = "Unbenutzt aber Positioniert";
-// Text [ english_us ] = "Unbenutzt aber Positioniert";
-// };
+/* ComboBox LB_FONT {
+ Pos = MAP_APPFONT( 127, 70 );
+ Size = MAP_APPFONT( 103, 12 );
+ Sort = TRUE;
+ DropDown = TRUE;
+ AutoSize = TRUE;
+ AutoHScroll = TRUE;
+ };*/
CheckBox CB_AUTOSAVE {
Pos = MAP_APPFONT( 127, 83 );
Size = MAP_APPFONT( 103, 12 );
@@ -3742,6 +3749,143 @@ TabPage RID_TP_SPECIAL {
};
+TabPage RID_TP_FONT {
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT( 244, 100 );
+ FixedText FT_FONTNAME {
+ Pos = MAP_APPFONT( 4, 2 );
+ Size = MAP_APPFONT( 123, 8 );
+ Text = "Art";
+ Text [ english_us ] = "art";
+ };
+ ComboBox CB_FONTNAME {
+ Pos = MAP_APPFONT( 4, 12 );
+ Size = MAP_APPFONT( 123, 12*4 );
+ Sort = TRUE;
+ AutoHScroll = TRUE;
+ };
+ FixedText FT_FONTSTYLE {
+ Pos = MAP_APPFONT( 131, 2 );
+ Size = MAP_APPFONT( 65, 8 );
+ Text = "Schnitt";
+ Text [ english_us ] = "??????";
+ };
+ ComboBox CB_FONTSTYLE {
+ Pos = MAP_APPFONT( 131, 12 );
+ Size = MAP_APPFONT( 65, 12*4 );
+ AutoHScroll = TRUE;
+ };
+ FixedText FT_FONTSIZE {
+ Pos = MAP_APPFONT( 200, 2 );
+ Size = MAP_APPFONT( 29, 8 );
+ Text = "Gre";
+ Text [ english_us ] = "Size";
+ };
+ MetricBox MB_FONTSIZE {
+ Pos = MAP_APPFONT( 200, 12 );
+ Size = MAP_APPFONT( 29, 12*4 );
+ AutoHScroll = TRUE;
+ };
+ FixedText FT_PREVIEW {
+ Pos = MAP_APPFONT( 4, 12*5+5 );
+ Size = MAP_APPFONT( 229, 30 );
+ };
+ // 229 is max
+ /*
+ FixedText LOG_TEXT {
+ Text = "Log Basisverzeichnis";
+ Text [ english_us ] = "Log home directory";
+ };
+ FixedText BASIS_TEXT {
+ Pos = MAP_APPFONT( 7, 28 );
+ Size = MAP_APPFONT( 76, 12 );
+ Text = "Basisverzeichnis";
+ Text [ english_us ] = "Home directory";
+ };
+ FixedText HID_TEXT {
+ Pos = MAP_APPFONT( 7, 44 );
+ Size = MAP_APPFONT( 76, 12 );
+ Text = "HID Verzeichnis";
+ Text [ english_us ] = "HID directory";
+ };
+ Edit LOG_NAME {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 87, 12 );
+ Size = MAP_APPFONT( 126, 12 );
+ TabStop = TRUE;
+ };
+ Edit BASIS_NAME {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 87, 28 );
+ Size = MAP_APPFONT( 126, 12 );
+ TabStop = TRUE;
+ };
+ Edit HID_NAME {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 87, 44 );
+ Size = MAP_APPFONT( 126, 12 );
+ TabStop = TRUE;
+ };
+ PushButton LOG_SET {
+ Pos = MAP_APPFONT( 217, 12 );
+ Size = MAP_APPFONT( 12, 12 );
+ Text = "...";
+ Text [ english_us ] = "...";
+ TabStop = TRUE;
+ };
+ PushButton BASIS_SET {
+ Pos = MAP_APPFONT( 217, 28 );
+ Size = MAP_APPFONT( 12, 12 );
+ Text = "...";
+ Text [ english_us ] = "...";
+ TabStop = TRUE;
+ };
+ PushButton HID_SET {
+ Pos = MAP_APPFONT( 217, 44 );
+ Size = MAP_APPFONT( 12, 12 );
+ Text = "...";
+ Text [ english_us ] = "...";
+ TabStop = TRUE;
+ };
+ FixedLine FL_OTHER {
+ Pos = MAP_APPFONT( 4, 60 );
+ Size = MAP_APPFONT( 230, 8 );
+ Text = "Andere Einstellungen";
+ Text [ english_us ] = "Other settings";
+ };
+ FixedText TIMEOUT_TEXT {
+ Pos = MAP_APPFONT( 8, 70 );
+ Size = MAP_APPFONT( 70, 12 );
+ Text = "Server Timeout";
+ Text [ english_us ] = "Server Timeout";
+ };
+ TimeField SERVER_TIMEOUT {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 83, 70 );
+ Size = MAP_APPFONT( 40, 12 );
+ TabStop = TRUE;
+ Repeat = TRUE;
+ Spin = TRUE;
+ Format = TIMEF_SEC;
+ Duration = TRUE;
+ };
+ CheckBox CB_AUTORELOAD {
+ Pos = MAP_APPFONT( 8, 83 );
+ Size = MAP_APPFONT( 115, 12 );
+ Text = "Automatischer Reload";
+ Text [ english_us ] = "AutoReload";
+ };
+ Pos = MAP_APPFONT( 127, 70 );
+ Size = MAP_APPFONT( 103, 12 );
+ CheckBox CB_AUTOSAVE {
+ Pos = MAP_APPFONT( 127, 83 );
+ Size = MAP_APPFONT( 103, 12 );
+ Text = "Speichern vor Ausfhren";
+ Text [ english_us ] = "Save before execute";
+ };*/
+};
+
FloatingWindow IDD_DISPLAY_HID {
OutputSize = TRUE;
diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx
index 29b7326c2ff7..7cde760c8297 100644
--- a/basic/source/app/brkpnts.cxx
+++ b/basic/source/app/brkpnts.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: brkpnts.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -263,6 +263,7 @@ void BreakpointWindow::AdjustBreakpoints( ULONG nLine, BOOL bInserted )
pBrk = Next();
}
}
+ Invalidate();
}
diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx
index 255bb7acc733..e49a16fb79f6 100644
--- a/basic/source/app/dialogs.cxx
+++ b/basic/source/app/dialogs.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dialogs.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: gh $ $Date: 2002-03-18 15:15:43 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,6 +72,9 @@ HACK( #define protected public )
#endif
#undef protected
+#ifndef _SV_METRIC_HXX
+#include <vcl/metric.hxx>
+#endif
#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
#endif
@@ -111,6 +114,9 @@ HACK( #define protected public )
#ifndef _ZFORLIST_HXX //autogen
#include <svtools/zformat.hxx>
#endif
+#ifndef _CTRLTOOL_HXX
+#include <svtools/ctrltool.hxx>
+#endif
#include <svtools/pver.hxx>
@@ -214,11 +220,9 @@ ConfEdit::ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nR
aEdit.SetText( aTemp );
}
-void ConfEdit::Save()
+void ConfEdit::Save( Config &aConf )
{
- Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Path");
-
aConf.WriteKey( aKeyName, ByteString( aEdit.GetText(), RTL_TEXTENCODING_UTF8 ) );
}
@@ -279,6 +283,9 @@ IMPL_LINK( OptionsDialog, ActivatePageHdl, TabControl *, pTabCtrl )
case RID_TP_GEN:
pNewTabPage = new GenericOptions( pTabCtrl );
break;
+ case RID_TP_FON:
+ pNewTabPage = new FontOptions( pTabCtrl );
+ break;
default: DBG_ERROR( "PageHdl: Unbekannte ID!" );
}
DBG_ASSERT( pNewTabPage, "Keine Page!" );
@@ -302,6 +309,12 @@ IMPL_LINK( OptionsDialog, OKClick, Button *, pButton )
if ( pGeneric )
pGeneric->Save();
+ FontOptions *pFonts;
+ pFonts = (FontOptions*)aTabCtrl.GetTabPage( RID_TP_FON );
+ if ( pFonts )
+ pFonts->Save();
+
+ ((BasicApp*)GetpApp())->LoadIniFile();
Close();
return 0;
}
@@ -335,18 +348,96 @@ SpecialOptions::SpecialOptions( Window* pParent )
void SpecialOptions::Save()
{
- aLog.Save();
- aBasis.Save();
- aHID.Save();
-
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
+ aLog.Save( aConf );
+ aBasis.Save( aConf );
+ aHID.Save( aConf );
+
aConf.SetGroup("Misc");
aConf.WriteKey( "ServerTimeout", ByteString::CreateFromInt32( aServerTimeout.GetTime().GetTime() ) );
aConf.WriteKey( "AutoReload", aAutoReload.IsChecked()?"1":"0" );
aConf.WriteKey( "AutoSave", aAutoSave.IsChecked()?"1":"0" );
+}
- aConf.Flush();
- ((BasicApp*)GetpApp())->LoadIniFile();
+
+FontOptions::FontOptions( Window* pParent )
+: TabPage( pParent, ResId( RID_TP_FONT ) )
+, aFTFontName( this, ResId(FT_FONTNAME) )
+, aFontName( this, ResId(CB_FONTNAME) )
+, aFTStyle( this, ResId(FT_FONTSTYLE) )
+, aFontStyle( this, ResId(CB_FONTSTYLE) )
+, aFTSize( this, ResId(FT_FONTSIZE) )
+, aFontSize( this, ResId(MB_FONTSIZE) )
+, aFTPreview( this, ResId(FT_PREVIEW) )
+, aFontList( this )
+{
+ FreeResource();
+
+ aFontName.Fill( &aFontList );
+ aFontName.EnableWYSIWYG();
+ aFontName.EnableSymbols();
+
+// aFontSize.SetUnit( FUNIT_POINT );
+// MapMode aMode( MAP_POINT );
+// aFTPreview.SetMapMode( aMode );
+
+ aFontName.SetModifyHdl( LINK( this, FontOptions, FontNameChanged ) );
+ aFontStyle.SetModifyHdl( LINK( this, FontOptions, FontStyleChanged ) );
+ aFontSize.SetModifyHdl( LINK( this, FontOptions, FontSizeChanged ) );
+
+ ByteString aTemp;
+ Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
+ aConf.SetGroup("Misc");
+ aTemp = aConf.ReadKey( "ScriptFontName", "Courier" );
+ aFontName.SetText( String( aTemp, RTL_TEXTENCODING_UTF8 ) );
+ aFontName.Modify();
+ aTemp = aConf.ReadKey( "ScriptFontStyle", "normal" );
+ aFontStyle.SetText( String( aTemp, RTL_TEXTENCODING_UTF8 ) );
+ aFontStyle.Modify();
+ aTemp = aConf.ReadKey( "ScriptFontSize", "12" );
+ aFontSize.SetText( String( aTemp, RTL_TEXTENCODING_UTF8 ) );
+ aFontSize.Modify();
+}
+
+IMPL_LINK( FontOptions, FontNameChanged, void*, EMPTYARG )
+{
+ aFontStyle.Fill( aFontName.GetText(), &aFontList );
+ FontStyleChanged( NULL );
+ return 0;
+}
+
+IMPL_LINK( FontOptions, FontStyleChanged, void*, EMPTYARG )
+{
+ aFontSize.Fill( aFontList.Get( aFontName.GetText(), aFontStyle.GetText() ), &aFontList );
+ FontSizeChanged( NULL );
+ return 0;
+}
+
+IMPL_LINK( FontOptions, FontSizeChanged, void*, EMPTYARG )
+{
+ UpdatePreview();
+ return 0;
+}
+
+void FontOptions::UpdatePreview()
+{
+ Font aFont = aFontList.Get( aFontName.GetText(), aFontStyle.GetText() );
+// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT );
+ ULONG nFontSize = (aFontSize.GetValue() + 5) / 10;
+ aFont.SetHeight( nFontSize );
+ aFTPreview.SetFont( aFont );
+ aFTPreview.SetText( aFontName.GetText() );
+ aFTPreview.Invalidate();
+}
+
+
+void FontOptions::Save()
+{
+ Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
+ aConf.SetGroup("Misc");
+ aConf.WriteKey( "ScriptFontName", aFontName.GetText(), RTL_TEXTENCODING_UTF8 );
+ aConf.WriteKey( "ScriptFontStyle", aFontStyle.GetText(), RTL_TEXTENCODING_UTF8 );
+ aConf.WriteKey( "ScriptFontSize", aFontSize.GetText(), RTL_TEXTENCODING_UTF8 );
}
diff --git a/basic/source/app/dialogs.hxx b/basic/source/app/dialogs.hxx
index 1fc7fd2521cf..d1be9f4766e8 100644
--- a/basic/source/app/dialogs.hxx
+++ b/basic/source/app/dialogs.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dialogs.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: gh $ $Date: 2002-03-18 15:15:43 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -101,6 +101,12 @@
#ifndef _SV_TOOLBOX_HXX //autogen
#include <vcl/toolbox.hxx>
#endif
+#ifndef _CTRLTOOL_HXX
+#include <svtools/ctrltool.hxx>
+#endif
+#ifndef _CTRLBOX_HXX
+#include <svtools/ctrlbox.hxx>
+#endif
class SbxVariable;
@@ -148,7 +154,7 @@ class ConfEdit : public PushButton
Edit aEdit;
public:
ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN );
- void Save();
+ void Save( Config &aConf );
void Click();
};
@@ -188,6 +194,32 @@ public:
void Save();
};
+class FontOptions : public TabPage
+{
+ FixedText aFTFontName;
+ FontNameBox aFontName;
+ FixedText aFTStyle;
+ FontStyleBox aFontStyle;
+ FixedText aFTSize;
+ FontSizeBox aFontSize;
+ FixedText aFTPreview;
+
+ FontList aFontList;
+
+// FixedLine aDirs;
+// FixedLine aOther;
+
+ DECL_LINK( FontNameChanged, void* );
+ DECL_LINK( FontStyleChanged, void* );
+ DECL_LINK( FontSizeChanged, void* );
+
+ void UpdatePreview();
+
+public:
+ FontOptions( Window* );
+ void Save();
+};
+
DECLARE_LIST( StringList, String * );
#define C_KEY_ALLE CByteString("Alle")
diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx
index b3e836a6feb3..6ed552e467b5 100644
--- a/basic/source/app/msgedit.cxx
+++ b/basic/source/app/msgedit.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: msgedit.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: gh $ $Date: 2002-03-28 14:43:03 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -123,13 +123,11 @@ MsgEdit::MsgEdit( AppError* pParent, BasicFrame *pBF, const WinBits& aBits )
, bModified(FALSE)
, pAppError( pParent )
{
- SetFont( aEditTree.GetDefaultFont( DEFAULTFONT_FIXED, aEditTree.GetSettings().GetLanguage(), 0, &aEditTree ) );
+// SetFont( aEditTree.GetDefaultFont( DEFAULTFONT_FIXED, aEditTree.GetSettings().GetLanguage(), 0, &aEditTree ) );
aEditTree.SetNodeBitmaps( Bitmap( ResId (MBP_PLUS) ), Bitmap( ResId (MBP_MINUS) ) );
aEditTree.SetSelectionMode( MULTIPLE_SELECTION );
if ( aEditTree.GetModel()->GetSortMode() != SortNone )
aEditTree.GetModel()->SetSortMode( SortNone );
-
- pParent->bHasFile = Load( pParent->GetText() );
}
MsgEdit::~MsgEdit()
diff --git a/basic/source/app/resids.hrc b/basic/source/app/resids.hrc
index 221e6d6da2f5..87e254c41d1e 100644
--- a/basic/source/app/resids.hrc
+++ b/basic/source/app/resids.hrc
@@ -2,9 +2,9 @@
*
* $RCSfile: resids.hrc,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: gh $ $Date: 2002-03-18 15:15:43 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -112,6 +112,16 @@
#define RID_PB_NEW_VALUE 57
#define RID_PB_DEL_VALUE 58
+// Font Settings
+#define RID_TP_FON 60
+#define FT_FONTNAME 61
+#define CB_FONTNAME 62
+#define FT_FONTSTYLE 63
+#define CB_FONTSTYLE 64
+#define FT_FONTSIZE 65
+#define MB_FONTSIZE 66
+#define FT_PREVIEW 67
+
// DisplayHId
#define RID_TB_CONF 70
#define RID_FT_CONTROLS 71
diff --git a/basic/source/app/textedit.cxx b/basic/source/app/textedit.cxx
index ee0b7707ce0f..3bedc4a13156 100644
--- a/basic/source/app/textedit.cxx
+++ b/basic/source/app/textedit.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textedit.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: gh $ $Date: 2001-11-07 10:38:59 $
+ * last change: $Author: gh $ $Date: 2002-04-11 08:38:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -723,12 +723,6 @@ TextEdit::TextEdit( AppEdit* pParent, const WinBits& aBits )
, bSaveAsUTF8( FALSE )
{
DBG_CTOR(TextEdit,0);
-
- Font aFont( aEdit.GetDefaultFont( DEFAULTFONT_FIXED, aEdit.GetSettings().GetLanguage(), 0, &aEdit ));
- aFont.SetTransparent( FALSE );
- aFont.SetAlign( ALIGN_BOTTOM );
- aFont.SetHeight( aFont.GetHeight()+2 );
- SetFont( aFont );
}
TextEdit::~TextEdit()