Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit StartUnit;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Menus, EditUnit, Vcl.Themes, Vcl.Styles,
- Vcl.Samples.Spin, ShowUnit;
- type
- TStartForm = class(TForm)
- ShowModeButton: TButton;
- EditModeButton: TButton;
- MainMenu: TMainMenu;
- InstructionMenu: TMenuItem;
- DeveloperMenu: TMenuItem;
- CostSpinEdit: TSpinEdit;
- ModeLabel: TLabel;
- ColorLabel: TLabel;
- LightRButton: TRadioButton;
- DarkRButton: TRadioButton;
- CostLabel: TLabel;
- procedure DeveloperMenuClick(Sender: TObject);
- procedure EditModeButtonClick(Sender: TObject);
- procedure ShowModeButtonClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure LightRButtonClick(Sender: TObject);
- procedure DarkRButtonClick(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure InstructionMenuClick(Sender: TObject);
- procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure FormKeyPress(Sender: TObject; var Key: Char);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- StartForm: TStartForm;
- ServiceCost: integer;
- implementation
- {$R *.dfm}
- uses
- WriteUnit;
- const
- LIGHT_SKIN = 'Smokey Quartz Kamri';
- DARK_SKIN = 'Charcoal Dark Slate';
- procedure TStartForm.DeveloperMenuClick(Sender: TObject);
- begin
- MessageDlg('Student: Ravodin Alexander Dmitrievich.' + #13#10 + 'Group: 151002.'
- + #13#10 + #13#10 + 'Contacts:' + #13#10 + 'VKontakte: ' +
- 'https://vk.com/ushouldbelieveme' + #13#10 +'E-mail: ' +
- 'telephonedatabasedev@gmail.com', MtInformation, [mbOk], 0);
- end;
- procedure TStartForm.InstructionMenuClick(Sender: TObject);
- begin
- MessageDlg('This is the start window. It includes next functions:' + #13#10 +
- '1. Сhoosing a work mod;' + #13#10 + '2. Choosing a color mod;' +
- #13#10 + '3. Provider cost setting.' + #13#10 + #13#10 + 'First' +
- ' option includes two modes:' + #13#10 + '- Show mode: allows' +
- 'you just to see subscribers using searching and sorting tools.'
- + #13#10 + '- Edit mode: includes 3 more functions:' + #13#10 +
- 'a) Adding subscribers;' + #13#10 + 'b) Editing current ' +
- 'subscriber''s data;' + #13#10 + 'c) Deleting subscribers;' +
- #13#10 + #13#10 + 'Color mode allow you to switch between ligth' +
- ' and dark themes.' + #13#10 + #13#10 + 'Setting a provider cost' +
- ' will determine the way of payment calсulation:' + #13#10 +
- 'You enter 30-days provider cost in dollars and new payments' +
- ' will be counted according to in.' + #13#10 + 'Press "ctrl + i"'
- + ' to open instruction;' + #13#10 + 'Press "esc" to exit program.',
- MtInformation, [mbOk], 0);
- end;
- procedure TStartForm.EditModeButtonClick(Sender: TObject);
- begin
- EditForm.show();
- StartForm.Enabled := false;
- ServiceCost := CostSpinEdit.value;
- end;
- procedure TStartForm.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- removeDeleters;
- end;
- procedure TStartForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
- begin
- CanClose := false;
- if MessageDlg('Are you sure if you want to exit?', mtConfirmation, mbYESNO, 0) = mrYES then
- begin
- CanClose := true;
- end;
- end;
- procedure TStartForm.FormCreate(Sender: TObject);
- begin
- TStyleManager.TrySetStyle(LIGHT_SKIN);
- LightRButton.Checked := true;
- end;
- procedure TStartForm.FormKeyPress(Sender: TObject; var Key: Char);
- begin
- if key = #27 then
- StartForm.Close()
- end;
- procedure TStartForm.LightRButtonClick(Sender: TObject);
- begin
- TStyleManager.TrySetStyle(LIGHT_SKIN);
- end;
- procedure TStartForm.DarkRButtonClick(Sender: TObject);
- begin
- TStyleManager.TrySetStyle(DARK_SKIN);
- end;
- procedure TStartForm.ShowModeButtonClick(Sender: TObject);
- begin;
- ServiceCost := CostSpinEdit.value;
- StartForm.Enabled := false;
- ShowForm.show();
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement