|
|
1.1 ! root 1: //--------------------------------------------------------------------- ! 2: #include <vcl.h> ! 3: #pragma hdrstop ! 4: ! 5: #include "NodeFormUnit.h" ! 6: #include "ClientFormUnit.h" ! 7: #include "TelnetFormUnit.h" ! 8: #include "EventsFormUnit.h" ! 9: #include "FtpFormUnit.h" ! 10: #include "WebFormUnit.h" ! 11: #include "MailFormUnit.h" ! 12: #include "ServicesFormUnit.h" ! 13: #include "PropertiesDlgUnit.h" ! 14: //--------------------------------------------------------------------- ! 15: #pragma resource "*.dfm" ! 16: TPropertiesDlg *PropertiesDlg; ! 17: //--------------------------------------------------------------------- ! 18: __fastcall TPropertiesDlg::TPropertiesDlg(TComponent* AOwner) ! 19: : TForm(AOwner) ! 20: { ! 21: } ! 22: //--------------------------------------------------------------------- ! 23: void __fastcall TPropertiesDlg::FormShow(TObject *Sender) ! 24: { ! 25: TrayIconCheckBoxClick(Sender); ! 26: PageControl->ActivePage=SettingsTabSheet; ! 27: SourceComboBoxChange(Sender); ! 28: } ! 29: //--------------------------------------------------------------------------- ! 30: ! 31: void __fastcall TPropertiesDlg::TrayIconCheckBoxClick(TObject *Sender) ! 32: { ! 33: PasswordEdit->Enabled=TrayIconCheckBox->Checked; ! 34: PasswordLabel->Enabled=PasswordEdit->Enabled; ! 35: } ! 36: //--------------------------------------------------------------------------- ! 37: ! 38: void __fastcall TPropertiesDlg::SourceComboBoxChange(TObject *Sender) ! 39: { ! 40: TargetComboBox->ItemIndex=SourceComboBox->ItemIndex; ! 41: switch(SourceComboBox->ItemIndex) { ! 42: case 0: /* Node List */ ! 43: ExampleEdit->Font=NodeForm->ListBox->Font; ! 44: ExampleEdit->Color=NodeForm->ListBox->Color; ! 45: break; ! 46: case 1: /* Client List */ ! 47: ExampleEdit->Font=ClientForm->ListView->Font; ! 48: ExampleEdit->Color=ClientForm->ListView->Color; ! 49: break; ! 50: case 2: /* Telnet Server Log */ ! 51: ExampleEdit->Font=TelnetForm->Log->Font; ! 52: ExampleEdit->Color=TelnetForm->Log->Color; ! 53: break; ! 54: case 3: /* Events Log */ ! 55: ExampleEdit->Font=EventsForm->Log->Font; ! 56: ExampleEdit->Color=EventsForm->Log->Color; ! 57: break; ! 58: case 4: /* FTP Server Log */ ! 59: ExampleEdit->Font=FtpForm->Log->Font; ! 60: ExampleEdit->Color=FtpForm->Log->Color; ! 61: break; ! 62: case 5: /* Mail Server Log */ ! 63: ExampleEdit->Font=MailForm->Log->Font; ! 64: ExampleEdit->Color=MailForm->Log->Color; ! 65: break; ! 66: case 6: /* Web Server Log */ ! 67: ExampleEdit->Font=WebForm->Log->Font; ! 68: ExampleEdit->Color=WebForm->Log->Color; ! 69: break; ! 70: case 7: /* Services Log */ ! 71: ExampleEdit->Font=ServicesForm->Log->Font; ! 72: ExampleEdit->Color=ServicesForm->Log->Color; ! 73: break; ! 74: } ! 75: } ! 76: //--------------------------------------------------------------------------- ! 77: ! 78: void __fastcall TPropertiesDlg::FontButtonClick(TObject *Sender) ! 79: { ! 80: TFontDialog *FontDialog=new TFontDialog(this); ! 81: ! 82: FontDialog->Font=ExampleEdit->Font; ! 83: if(FontDialog->Execute()) ! 84: ExampleEdit->Font->Assign(FontDialog->Font); ! 85: delete FontDialog; ! 86: } ! 87: //--------------------------------------------------------------------------- ! 88: ! 89: void __fastcall TPropertiesDlg::BackgroundButtonClick(TObject *Sender) ! 90: { ! 91: TColorDialog* ColorDialog=new TColorDialog(this); ! 92: ! 93: ColorDialog->Options << cdPreventFullOpen; ! 94: ColorDialog->Color=ExampleEdit->Color; ! 95: if(ColorDialog->Execute()) ! 96: ExampleEdit->Color=ColorDialog->Color; ! 97: delete ColorDialog; ! 98: } ! 99: //--------------------------------------------------------------------------- ! 100: void __fastcall TPropertiesDlg::ChangeScheme(int target) ! 101: { ! 102: switch(target) { ! 103: case 0: /* Node List */ ! 104: NodeForm->ListBox->Font=ExampleEdit->Font; ! 105: NodeForm->ListBox->Color=ExampleEdit->Color; ! 106: break; ! 107: case 1: /* Client List */ ! 108: ClientForm->ListView->Font=ExampleEdit->Font; ! 109: ClientForm->ListView->Color=ExampleEdit->Color; ! 110: break; ! 111: case 2: /* Telnet Server Log */ ! 112: TelnetForm->Log->Font=ExampleEdit->Font; ! 113: TelnetForm->Log->Color=ExampleEdit->Color; ! 114: break; ! 115: case 3: /* Events Log */ ! 116: EventsForm->Log->Font=ExampleEdit->Font; ! 117: EventsForm->Log->Color=ExampleEdit->Color; ! 118: break; ! 119: case 4: /* FTP Server Log */ ! 120: FtpForm->Log->Font=ExampleEdit->Font; ! 121: FtpForm->Log->Color=ExampleEdit->Color; ! 122: break; ! 123: case 5: /* Mail Server Log */ ! 124: MailForm->Log->Font=ExampleEdit->Font; ! 125: MailForm->Log->Color=ExampleEdit->Color; ! 126: break; ! 127: case 6: /* Web Server Log */ ! 128: WebForm->Log->Font=ExampleEdit->Font; ! 129: WebForm->Log->Color=ExampleEdit->Color; ! 130: break; ! 131: case 7: /* Services Log */ ! 132: ServicesForm->Log->Font=ExampleEdit->Font; ! 133: ServicesForm->Log->Color=ExampleEdit->Color; ! 134: break; ! 135: } ! 136: } ! 137: //--------------------------------------------------------------------------- ! 138: void __fastcall TPropertiesDlg::ApplyButtonClick(TObject *Sender) ! 139: { ! 140: if(TargetComboBox->ItemIndex==SourceComboBox->Items->Count) { ! 141: for(int i=0;i<SourceComboBox->Items->Count;i++) ! 142: ChangeScheme(i); ! 143: } else ! 144: ChangeScheme(TargetComboBox->ItemIndex); ! 145: } ! 146: //--------------------------------------------------------------------------- ! 147:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.