diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gfxbase.pas | 9 | ||||
-rw-r--r-- | src/corelib/lang_afrikaans.inc | 1 | ||||
-rw-r--r-- | src/corelib/lang_english.inc | 2 | ||||
-rw-r--r-- | src/corelib/lang_french.inc | 1 | ||||
-rw-r--r-- | src/corelib/lang_german.inc | 1 | ||||
-rw-r--r-- | src/corelib/lang_italian.inc | 1 | ||||
-rw-r--r-- | src/corelib/lang_portuguese.inc | 1 | ||||
-rw-r--r-- | src/corelib/lang_russian.inc | 1 | ||||
-rw-r--r-- | src/corelib/lang_spanish.inc | 1 | ||||
-rw-r--r-- | src/gui/fpgui_package.lpk | 5 | ||||
-rw-r--r-- | src/gui/gui_dialogs.pas | 1 | ||||
-rw-r--r-- | src/gui/promptuserdialog.inc | 108 |
12 files changed, 109 insertions, 23 deletions
diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index 1e7984ed..ade4d74e 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -380,13 +380,11 @@ type end; - { TfpgApplicationBase } - TfpgApplicationBase = class(TComponent) private FMainForm: TfpgWindowBase; FTerminated: boolean; - function GetTopModalForm: TfpgWindowBase; + function GetTopModalForm: TfpgWindowBase; protected FIsInitialized: Boolean; FModalFormStack: TList; @@ -421,9 +419,11 @@ type property Text: string read DoGetText write DoSetText; end; + TFileEntryType = (etFile, etDir); TFileListSortOrder = (soNone, soFileName, soCSFileName, soFileExt, soSize, soTime); + // A simple data object TFileEntry = class(TObject) private @@ -453,7 +453,6 @@ type property LinkTarget: string read FLinkTarget write FLinkTarget; end; - { TfpgFileListBase } TfpgFileListBase = class(TObject) private @@ -941,6 +940,8 @@ end; procedure TfpgWindowBase.MoveWindow(const x: TfpgCoord; const y: TfpgCoord); begin + Left := x; + Top := y; DoMoveWindow(x, y); end; diff --git a/src/corelib/lang_afrikaans.inc b/src/corelib/lang_afrikaans.inc index 3e1941ce..78115662 100644 --- a/src/corelib/lang_afrikaans.inc +++ b/src/corelib/lang_afrikaans.inc @@ -98,6 +98,7 @@ rsSaveAFile = 'Stoor ''n ler'; // User Dialog rsUserName = 'Gebruikers naam'; rsPassword = 'Wagwoord'; +rsDatabase = 'Database'; // Error messages diff --git a/src/corelib/lang_english.inc b/src/corelib/lang_english.inc index d3f191c0..ec2b85a7 100644 --- a/src/corelib/lang_english.inc +++ b/src/corelib/lang_english.inc @@ -98,7 +98,7 @@ rsSaveAFile = 'Save file as'; // User Dialog rsUserName = 'User name'; rsPassword = 'Password'; - +rsDatabase = 'Database'; // Error messages rsErrListMustBeEmpty = 'List must be empty'; diff --git a/src/corelib/lang_french.inc b/src/corelib/lang_french.inc index 0d186126..385a2271 100644 --- a/src/corelib/lang_french.inc +++ b/src/corelib/lang_french.inc @@ -98,6 +98,7 @@ rsSaveAFile = 'Sauver sous'; // User Dialog rsUserName = 'User name'; rsPassword = 'Password'; +rsDatabase = 'Database'; // Error messages diff --git a/src/corelib/lang_german.inc b/src/corelib/lang_german.inc index df5ca54f..45b736fc 100644 --- a/src/corelib/lang_german.inc +++ b/src/corelib/lang_german.inc @@ -98,6 +98,7 @@ rsSaveAFile = 'Datei speichern'; // User Dialog rsUserName = 'User name'; rsPassword = 'Password'; +rsDatabase = 'Database'; // Error messages diff --git a/src/corelib/lang_italian.inc b/src/corelib/lang_italian.inc index e4980ddb..e0fb8a35 100644 --- a/src/corelib/lang_italian.inc +++ b/src/corelib/lang_italian.inc @@ -98,6 +98,7 @@ rsSaveAFile = 'Salva con nome'; // User Dialog rsUserName = 'Nome utente'; rsPassword = 'Password'; +rsDatabase = 'Archivi'; // Error messages rsErrListMustBeEmpty = 'Elenco deve essere vuoto'; diff --git a/src/corelib/lang_portuguese.inc b/src/corelib/lang_portuguese.inc index ae6edef5..9accff06 100644 --- a/src/corelib/lang_portuguese.inc +++ b/src/corelib/lang_portuguese.inc @@ -98,6 +98,7 @@ rsSaveAFile = 'Salvar arquivo como'; // User Dialog rsUserName = 'User name'; rsPassword = 'Password'; +rsDatabase = 'Database'; // Error messages diff --git a/src/corelib/lang_russian.inc b/src/corelib/lang_russian.inc index 544d3345..32dd7380 100644 --- a/src/corelib/lang_russian.inc +++ b/src/corelib/lang_russian.inc @@ -98,6 +98,7 @@ rsSaveAFile = 'Сохранить файл как'; // User Dialog rsUserName = 'Имя пользователя'; rsPassword = 'Пароль'; +rsDatabase = 'Database'; // Error messages diff --git a/src/corelib/lang_spanish.inc b/src/corelib/lang_spanish.inc index 492978b8..f7dbbda4 100644 --- a/src/corelib/lang_spanish.inc +++ b/src/corelib/lang_spanish.inc @@ -98,6 +98,7 @@ rsSaveAFile = 'Guardar como'; // User Dialog rsUserName = 'User name'; rsPassword = 'Password'; +rsDatabase = 'Database'; // Error messages diff --git a/src/gui/fpgui_package.lpk b/src/gui/fpgui_package.lpk index 0fc84c46..727594b7 100644 --- a/src/gui/fpgui_package.lpk +++ b/src/gui/fpgui_package.lpk @@ -17,11 +17,6 @@ <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> - <Linking> - <Debugging> - <GenerateDebugInfo Value="True"/> - </Debugging> - </Linking> <Other> <CustomOptions Value="-B "/> diff --git a/src/gui/gui_dialogs.pas b/src/gui/gui_dialogs.pas index 660eb1e7..1437a492 100644 --- a/src/gui/gui_dialogs.pas +++ b/src/gui/gui_dialogs.pas @@ -211,6 +211,7 @@ uses {$IFDEF MSWINDOWS} ,Windows // used by File Dialog {$ENDIF} + ,DateUtils ; diff --git a/src/gui/promptuserdialog.inc b/src/gui/promptuserdialog.inc index ccb04a94..9c5e5d0f 100644 --- a/src/gui/promptuserdialog.inc +++ b/src/gui/promptuserdialog.inc @@ -5,19 +5,36 @@ { TfpgPromptUserDialog } -TfpgPromptUserDialog = class(TfpgBaseDialog) -private - lblTitle: TfpgLabel; - lblTitlePw: TfpgLabel; - edUserID: TfpgEdit; - edPassword: TfpgEdit; - function GetUserID: TfpgString; - function GetUserPassword: TfpgString; -public - constructor Create(AOwner: TComponent); override; - property UserID: TfpgString read GetUserID; - property Password: TfpgString read GetUserPassword; -end; + TfpgPromptUserDialog = class(TfpgBaseDialog) + private + lblTitle: TfpgLabel; + lblTitlePw: TfpgLabel; + edUserID: TfpgEdit; + edPassword: TfpgEdit; + function GetUserID: TfpgString; + function GetUserPassword: TfpgString; + public + constructor Create(AOwner: TComponent); override; + // Gof defines this Authenticate method a Hook operation in Template methods pattern. + // Subclass will have to override and implement it. By default it returns True. + function Authenticate: boolean; virtual; + procedure Wiggle(const Seconds: integer = 1; const MovingPixels: integer = 5; const aSleep: integer = 75); + property UserID: TfpgString read GetUserID; + property Password: TfpgString read GetUserPassword; + end; + + + TfpgPromptUserDbDialog = class(TfpgPromptUserDialog) + private + lblDatabases: TfpgLabel; + protected + aStringList: TStringList; + cbDatabases: TfpgComboBox; + procedure PopulateComboDb; virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; {$ENDIF read_interface} @@ -70,6 +87,71 @@ begin btnCancel.TabOrder := 4; end; +function TfpgPromptUserDialog.Authenticate: boolean; +begin + Result := True; +end; + +procedure TfpgPromptUserDialog.Wiggle(const Seconds: integer; const MovingPixels: integer; const aSleep: integer); +var + MyTime: TDateTime; +begin + MyTime := Now; + repeat + MoveWindow(Left - MovingPixels, Top); + fpgApplication.ProcessMessages; + Sleep(aSleep); + MoveWindow(Left + MovingPixels * 2, Top); + fpgApplication.ProcessMessages; + Sleep(aSleep); + MoveWindow(Left - MovingPixels, Top); + fpgApplication.ProcessMessages; + until SecondsBetween(Now, MyTime) >= Seconds; +end; + +{ TfpgPromptUserDbDialog } + +constructor TfpgPromptUserDbDialog.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + // reset dimensions + Width := 200; + Height := 185; + MinWidth := 200; + MinHeight := 185; + + aStringList := TStringList.Create; + + lblDatabases := CreateLabel(self, 8, 101, rsDatabase); + cbDatabases := CreateComboBox(self, 8, 119, 184, aStringList); + cbDatabases.Anchors := [anLeft, anTop, anRight]; + + // reposition buttons + btnCancel.Left := Width-FDefaultButtonWidth-FSpacing; + btnCancel.Top := Height - FSpacing - btnCancel.Height; + btnOK.Left := btnCancel.Left-FDefaultButtonWidth-FSpacing; + btnOK.Top := btnCancel.Top; + + // now reset tab order + edUserID.TabOrder := 1; + edPassword.TabOrder := 2; + cbDatabases.TabOrder := 3; + btnOK.TabOrder := 5; + btnCancel.TabOrder := 6; + + PopulateComboDb; +end; + +destructor TfpgPromptUserDbDialog.Destroy; +begin + aStringList.Free; + inherited Destroy; +end; + +procedure TfpgPromptUserDbDialog.PopulateComboDb; +begin + // do nothing. Derived classe will implement it +end; {$ENDIF read_implementation} |