diff --git a/src/sbbs3/ctrl/TextFileEditUnit.cpp b/src/sbbs3/ctrl/TextFileEditUnit.cpp index ee8925644cc9508b5d3bb89b623d7da8f5d20329..43593f0314f6d8f254e191ea7ab74416753138c6 100644 --- a/src/sbbs3/ctrl/TextFileEditUnit.cpp +++ b/src/sbbs3/ctrl/TextFileEditUnit.cpp @@ -237,3 +237,21 @@ void __fastcall TTextFileEditForm::UndoExecute(TObject *Sender) } //--------------------------------------------------------------------------- +void __fastcall TTextFileEditForm::ChangeFontExecute(TObject *Sender) +{ + FontDialog->Font->Assign(Memo->Font); + FontDialog->Execute(); + Memo->Font->Assign(FontDialog->Font); +} +//--------------------------------------------------------------------------- + +void __fastcall TTextFileEditForm::FontDialogApply(TObject *Sender, + HWND Wnd) +{ + Memo->Font->Assign(FontDialog->Font); +} +//--------------------------------------------------------------------------- + + + + diff --git a/src/sbbs3/ctrl/TextFileEditUnit.dfm b/src/sbbs3/ctrl/TextFileEditUnit.dfm index c869c7a1db6823eb25a6a281f5ef343f55ea5f73..4e9af04762fd4c95790c727451703155ddf6c0f0 100644 --- a/src/sbbs3/ctrl/TextFileEditUnit.dfm +++ b/src/sbbs3/ctrl/TextFileEditUnit.dfm @@ -1,13 +1,13 @@ object TextFileEditForm: TTextFileEditForm - Left = 329 - Top = 236 + Left = 476 + Top = 367 Width = 783 Height = 540 Caption = 'TextFileEditForm' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -10 + Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] Icon.Data = { @@ -39,21 +39,21 @@ object TextFileEditForm: TTextFileEditForm OldCreateOrder = False Position = poDefaultPosOnly OnShow = FormShow - PixelsPerInch = 96 - TextHeight = 13 + PixelsPerInch = 120 + TextHeight = 16 object Panel: TPanel Left = 0 Top = 0 Width = 775 - Height = 27 + Height = 33 Align = alTop BevelOuter = bvNone TabOrder = 0 object OkButton: TBitBtn - Left = 8 - Top = 3 - Width = 73 - Height = 21 + Left = 10 + Top = 4 + Width = 90 + Height = 26 Action = Save Caption = 'OK' ModalResult = 1 @@ -74,10 +74,10 @@ object TextFileEditForm: TTextFileEditForm NumGlyphs = 2 end object CancelButton: TBitBtn - Left = 85 - Top = 3 - Width = 73 - Height = 21 + Left = 105 + Top = 4 + Width = 89 + Height = 26 Caption = 'Discard' ModalResult = 2 TabOrder = 1 @@ -99,13 +99,13 @@ object TextFileEditForm: TTextFileEditForm end object Memo: TRichEdit Left = 0 - Top = 27 + Top = 33 Width = 775 - Height = 467 + Height = 451 Align = alClient Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -15 Font.Name = 'Courier' Font.Style = [] HideSelection = False @@ -178,6 +178,9 @@ object TextFileEditForm: TTextFileEditForm Action = InsertCtrlA end end + object FontMenuItem: TMenuItem + Action = ChangeFont + end end object PopupMenu: TPopupMenu Left = 184 @@ -257,5 +260,22 @@ object TextFileEditForm: TTextFileEditForm ShortCut = 16474 OnExecute = UndoExecute end + object ChangeFont: TAction + Caption = 'Font' + OnExecute = ChangeFontExecute + end + end + object FontDialog: TFontDialog + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + MinFontSize = 0 + MaxFontSize = 0 + Options = [fdApplyButton] + OnApply = FontDialogApply + Left = 144 + Top = 80 end end diff --git a/src/sbbs3/ctrl/TextFileEditUnit.h b/src/sbbs3/ctrl/TextFileEditUnit.h index 5e9770b70ade088e9b4a27025d70b1f65a7151d2..d351d699041b3f96190955156e336524d43dbd4d 100644 --- a/src/sbbs3/ctrl/TextFileEditUnit.h +++ b/src/sbbs3/ctrl/TextFileEditUnit.h @@ -93,6 +93,9 @@ __published: // IDE-managed Components TMenuItem *CutPopupMenuItem; TMenuItem *CopyPopupMenuItem; TMenuItem *PastePopupMenuItem; + TFontDialog *FontDialog; + TMenuItem *FontMenuItem; + TAction *ChangeFont; void __fastcall FormShow(TObject *Sender); void __fastcall FontButtonClick(TObject *Sender); void __fastcall FindDialogFind(TObject *Sender); @@ -107,6 +110,8 @@ __published: // IDE-managed Components void __fastcall CopyExecute(TObject *Sender); void __fastcall PasteExecute(TObject *Sender); void __fastcall UndoExecute(TObject *Sender); + void __fastcall ChangeFontExecute(TObject *Sender); + void __fastcall FontDialogApply(TObject *Sender, HWND Wnd); private: // User declarations public: // User declarations __fastcall TTextFileEditForm(TComponent* Owner);