|
|
1.1.1.2 ! root 1: /* $Id: PropertiesDlgUnit.cpp,v 1.8 2009/10/25 05:05:54 rswindell Exp $ */ 1.1 root 2: 3: /**************************************************************************** 4: * @format.tab-size 4 (Plain Text/Source Code File Header) * 5: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * 6: * * 1.1.1.2 ! root 7: * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * 1.1 root 8: * * 9: * This program is free software; you can redistribute it and/or * 10: * modify it under the terms of the GNU General Public License * 11: * as published by the Free Software Foundation; either version 2 * 12: * of the License, or (at your option) any later version. * 13: * See the GNU General Public License for more details: gpl.txt or * 14: * http://www.fsf.org/copyleft/gpl.html * 15: * * 16: * Anonymous FTP access to the most recent released source is available at * 17: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * 18: * * 19: * Anonymous CVS access to the development source and modification history * 20: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * 21: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * 22: * (just hit return, no password is necessary) * 23: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * 24: * * 25: * For Synchronet coding style and modification guidelines, see * 26: * http://www.synchro.net/source.html * 27: * * 28: * You are encouraged to submit any modifications (preferably in Unix diff * 29: * format) via e-mail to [email protected] * 30: * * 31: * Note: If this box doesn't appear square, then you need to fix your tabs. * 32: ****************************************************************************/ 33: 34: //--------------------------------------------------------------------- 35: #include <vcl.h> 36: #pragma hdrstop 37: 38: #include "NodeFormUnit.h" 39: #include "ClientFormUnit.h" 40: #include "TelnetFormUnit.h" 41: #include "EventsFormUnit.h" 42: #include "FtpFormUnit.h" 43: #include "WebFormUnit.h" 44: #include "MailFormUnit.h" 45: #include "ServicesFormUnit.h" 46: #include "PropertiesDlgUnit.h" 1.1.1.2 ! root 47: #include <mmsystem.h> // sndPlaySound() 1.1 root 48: //--------------------------------------------------------------------- 49: #pragma resource "*.dfm" 50: TPropertiesDlg *PropertiesDlg; 51: //--------------------------------------------------------------------- 52: __fastcall TPropertiesDlg::TPropertiesDlg(TComponent* AOwner) 53: : TForm(AOwner) 54: { 55: } 56: //--------------------------------------------------------------------- 57: void __fastcall TPropertiesDlg::FormShow(TObject *Sender) 58: { 59: TrayIconCheckBoxClick(Sender); 60: PageControl->ActivePage=SettingsTabSheet; 61: SourceComboBoxChange(Sender); 1.1.1.2 ! root 62: LogLevelComboBoxChange(Sender); 1.1 root 63: } 64: //--------------------------------------------------------------------------- 65: 66: void __fastcall TPropertiesDlg::TrayIconCheckBoxClick(TObject *Sender) 67: { 68: PasswordEdit->Enabled=TrayIconCheckBox->Checked; 69: PasswordLabel->Enabled=PasswordEdit->Enabled; 70: } 71: //--------------------------------------------------------------------------- 72: 73: void __fastcall TPropertiesDlg::SourceComboBoxChange(TObject *Sender) 74: { 75: TargetComboBox->ItemIndex=SourceComboBox->ItemIndex; 76: switch(SourceComboBox->ItemIndex) { 77: case 0: /* Node List */ 78: ExampleEdit->Font=NodeForm->ListBox->Font; 79: ExampleEdit->Color=NodeForm->ListBox->Color; 80: break; 81: case 1: /* Client List */ 82: ExampleEdit->Font=ClientForm->ListView->Font; 83: ExampleEdit->Color=ClientForm->ListView->Color; 84: break; 1.1.1.2 ! root 85: case 2: /* Terminal Server Log */ 1.1 root 86: ExampleEdit->Font=TelnetForm->Log->Font; 87: ExampleEdit->Color=TelnetForm->Log->Color; 88: break; 89: case 3: /* Events Log */ 90: ExampleEdit->Font=EventsForm->Log->Font; 91: ExampleEdit->Color=EventsForm->Log->Color; 92: break; 93: case 4: /* FTP Server Log */ 94: ExampleEdit->Font=FtpForm->Log->Font; 95: ExampleEdit->Color=FtpForm->Log->Color; 96: break; 97: case 5: /* Mail Server Log */ 98: ExampleEdit->Font=MailForm->Log->Font; 99: ExampleEdit->Color=MailForm->Log->Color; 100: break; 101: case 6: /* Web Server Log */ 102: ExampleEdit->Font=WebForm->Log->Font; 103: ExampleEdit->Color=WebForm->Log->Color; 104: break; 105: case 7: /* Services Log */ 106: ExampleEdit->Font=ServicesForm->Log->Font; 107: ExampleEdit->Color=ServicesForm->Log->Color; 108: break; 109: } 110: } 111: //--------------------------------------------------------------------------- 112: 113: void __fastcall TPropertiesDlg::FontButtonClick(TObject *Sender) 114: { 115: TFontDialog *FontDialog=new TFontDialog(this); 116: 117: FontDialog->Font=ExampleEdit->Font; 118: if(FontDialog->Execute()) 119: ExampleEdit->Font->Assign(FontDialog->Font); 120: delete FontDialog; 121: } 122: //--------------------------------------------------------------------------- 123: 124: void __fastcall TPropertiesDlg::BackgroundButtonClick(TObject *Sender) 125: { 126: TColorDialog* ColorDialog=new TColorDialog(this); 127: 128: ColorDialog->Options << cdPreventFullOpen; 129: ColorDialog->Color=ExampleEdit->Color; 130: if(ColorDialog->Execute()) 131: ExampleEdit->Color=ColorDialog->Color; 132: delete ColorDialog; 133: } 134: //--------------------------------------------------------------------------- 135: void __fastcall TPropertiesDlg::ChangeScheme(int target) 136: { 137: switch(target) { 138: case 0: /* Node List */ 139: NodeForm->ListBox->Font=ExampleEdit->Font; 140: NodeForm->ListBox->Color=ExampleEdit->Color; 141: break; 142: case 1: /* Client List */ 143: ClientForm->ListView->Font=ExampleEdit->Font; 144: ClientForm->ListView->Color=ExampleEdit->Color; 145: break; 1.1.1.2 ! root 146: case 2: /* Terminal Server Log */ 1.1 root 147: TelnetForm->Log->Font=ExampleEdit->Font; 148: TelnetForm->Log->Color=ExampleEdit->Color; 149: break; 150: case 3: /* Events Log */ 151: EventsForm->Log->Font=ExampleEdit->Font; 152: EventsForm->Log->Color=ExampleEdit->Color; 153: break; 154: case 4: /* FTP Server Log */ 155: FtpForm->Log->Font=ExampleEdit->Font; 156: FtpForm->Log->Color=ExampleEdit->Color; 157: break; 158: case 5: /* Mail Server Log */ 159: MailForm->Log->Font=ExampleEdit->Font; 160: MailForm->Log->Color=ExampleEdit->Color; 161: break; 162: case 6: /* Web Server Log */ 163: WebForm->Log->Font=ExampleEdit->Font; 164: WebForm->Log->Color=ExampleEdit->Color; 165: break; 166: case 7: /* Services Log */ 167: ServicesForm->Log->Font=ExampleEdit->Font; 168: ServicesForm->Log->Color=ExampleEdit->Color; 169: break; 170: } 171: } 172: //--------------------------------------------------------------------------- 173: void __fastcall TPropertiesDlg::ApplyButtonClick(TObject *Sender) 174: { 175: if(TargetComboBox->ItemIndex==SourceComboBox->Items->Count) { 176: for(int i=0;i<SourceComboBox->Items->Count;i++) 177: ChangeScheme(i); 178: } else 179: ChangeScheme(TargetComboBox->ItemIndex); 180: } 181: //--------------------------------------------------------------------------- 1.1.1.2 ! root 182: void __fastcall TPropertiesDlg::LogLevelComboBoxChange(TObject *Sender) ! 183: { ! 184: LogFontExampleEdit->Font->Assign(MainForm->LogFont[LogLevelComboBox->ItemIndex]); ! 185: } ! 186: //--------------------------------------------------------------------------- ! 187: ! 188: void __fastcall TPropertiesDlg::LogFontButtonClick(TObject *Sender) ! 189: { ! 190: TFontDialog *FontDialog=new TFontDialog(this); ! 191: ! 192: FontDialog->Font=LogFontExampleEdit->Font; ! 193: if(FontDialog->Execute()) { ! 194: LogFontExampleEdit->Font->Assign(FontDialog->Font); ! 195: MainForm->LogFont[LogLevelComboBox->ItemIndex]->Assign(FontDialog->Font); ! 196: } ! 197: delete FontDialog; ! 198: } ! 199: //--------------------------------------------------------------------------- ! 200: ! 201: void __fastcall TPropertiesDlg::ErrorSoundButtonClick(TObject *Sender) ! 202: { ! 203: OpenDialog->FileName=ErrorSoundEdit->Text; ! 204: if(OpenDialog->Execute()==true) { ! 205: ErrorSoundEdit->Text=OpenDialog->FileName; ! 206: sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); ! 207: } ! 208: } ! 209: //--------------------------------------------------------------------------- 1.1 root 210:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.