Skip to content
Snippets Groups Projects
Commit b73ad171 authored by rswindell's avatar rswindell
Browse files

Created a right-click popup menu on the File Preview window to change the

current font (shared with the Spy Terminal window).
parent 25741378
No related branches found
No related tags found
No related merge requests found
/* $Id$ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
//---------------------------------------------------------------------------
#include <vcl.h>
......@@ -29,6 +62,7 @@ __fastcall TPreviewForm::~TPreviewForm()
delete Terminal;
}
#define ANSI_ESC "\x1b["
//---------------------------------------------------------------------------
......@@ -160,4 +194,16 @@ void __fastcall TPreviewForm::FormClose(TObject *Sender,
}
//---------------------------------------------------------------------------
void __fastcall TPreviewForm::ChangeFontMenuItemClick(TObject *Sender)
{
TFontDialog *FontDialog=new TFontDialog(this);
FontDialog->Font=MainForm->SpyTerminalFont;
FontDialog->Execute();
MainForm->SpyTerminalFont->Assign(FontDialog->Font);
Terminal->Font=MainForm->SpyTerminalFont;
delete FontDialog;
Terminal->UpdateScreen();
}
//---------------------------------------------------------------------------
object PreviewForm: TPreviewForm
Left = 392
Top = 374
Width = 622
Height = 309
Left = 504
Top = 375
Width = 585
Height = 364
Caption = 'Preview'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Height = -14
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poDefault
PopupMenu = PopupMenu
Position = poDefaultPosOnly
OnClose = FormClose
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
PixelsPerInch = 120
TextHeight = 16
object PopupMenu: TPopupMenu
Left = 144
Top = 24
object ChangeFontMenuItem: TMenuItem
Caption = 'Change Font'
Hint = 'Change Font'
OnClick = ChangeFontMenuItemClick
end
end
end
/* $Id$ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
//---------------------------------------------------------------------------
#ifndef PreviewFormUnitH
......@@ -7,13 +40,17 @@
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "emulvt.hpp" /* TEmulVT */
#include "emulvt.hpp" /* TEmulVT */
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TPreviewForm : public TForm
{
__published: // IDE-managed Components
TPopupMenu *PopupMenu;
TMenuItem *ChangeFontMenuItem;
void __fastcall FormShow(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall ChangeFontMenuItemClick(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TPreviewForm(TComponent* Owner);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment