mORMot and Open Source friends
Check-in [0e7d678761]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:
  • added tdfQueryFieldFocused optional flag to focus the input field component
  • InputBox function will now focus the input field component by default
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0e7d67876124b251bf845977edb4a59b4226c71c
User & Date: G018869 2012-03-29 13:13:33
Context
2012-03-29
13:30
more than MAX_SQLFIELDS-1 columns (by default, 63) will raise an exception check-in: d80a9a9a46 user: G018869 tags: trunk
13:13
  • added tdfQueryFieldFocused optional flag to focus the input field component
  • InputBox function will now focus the input field component by default
check-in: 0e7d678761 user: G018869 tags: trunk
2012-03-28
20:58
fixed Delphi <2010 compilation issues check-in: ac32fbb645 user: User tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SQLite3/SQLite3UILogin.pas.

1
2
3
4
5
6
7
8
9
10
..
64
65
66
67
68
69
70



71
72
73
74
75
76
77
...
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
/// some common User Interface functions and dialogs
// - this unit is a part of the freeware Synopse SQLite3 database framework,
// licensed under a MPL/GPL/LGPL tri-license; version 1.15
unit SQLite3UILogin;

(*
    This file is part of Synopse SQLite3 database framework.

    Synopse SQLite3 database framework. Copyright (C) 2012 Arnaud Bouchez
      Synopse Informatique - http://synopse.info
................................................................................
      TaskDialog, with a fallback dialog written in Delphi under XP
    - use a best available font (Calibri or Tahoma), and useful bitmaps

    Version 1.15
    - new InputBox global function
    - new QueryMasked parameter to display * in InputBox/InputQuery editor field




*)

interface

{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64

uses
................................................................................
    result := -1 else
    dec(result,100);
end;

function InputQuery(const ACaption, APrompt: string; var Value: string;
  QueryMasked: boolean=false): Boolean;
const FLAGS: array[boolean] of TTaskDialogFlags = (
   [tdfQuery],[tdfQuery,tdfQueryMasked]);
var Task: TTaskDialog;
begin
  Task.Inst := ACaption;
  Task.Content := APrompt;
  Task.Query := Value;
  result := Task.Execute([cbOk,cbCancel],0,FLAGS[QueryMasked],tiQuestion)=mrOk;
  if result then

|







 







>
>
>







 







|







1
2
3
4
5
6
7
8
9
10
..
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
...
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
/// some common User Interface functions and dialogs
// - this unit is a part of the freeware Synopse SQLite3 database framework,
// licensed under a MPL/GPL/LGPL tri-license; version 1.16
unit SQLite3UILogin;

(*
    This file is part of Synopse SQLite3 database framework.

    Synopse SQLite3 database framework. Copyright (C) 2012 Arnaud Bouchez
      Synopse Informatique - http://synopse.info
................................................................................
      TaskDialog, with a fallback dialog written in Delphi under XP
    - use a best available font (Calibri or Tahoma), and useful bitmaps

    Version 1.15
    - new InputBox global function
    - new QueryMasked parameter to display * in InputBox/InputQuery editor field

    Version 1.16
    - InputBox function will now focus the input field component by default

*)

interface

{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64

uses
................................................................................
    result := -1 else
    dec(result,100);
end;

function InputQuery(const ACaption, APrompt: string; var Value: string;
  QueryMasked: boolean=false): Boolean;
const FLAGS: array[boolean] of TTaskDialogFlags = (
   [tdfQuery,tdfQueryFieldFocused],[tdfQuery,tdfQueryMasked,tdfQueryFieldFocused]);
var Task: TTaskDialog;
begin
  Task.Inst := ACaption;
  Task.Content := APrompt;
  Task.Query := Value;
  result := Task.Execute([cbOk,cbCancel],0,FLAGS[QueryMasked],tiQuestion)=mrOk;
  if result then

Changes to SynTaskDialog.pas.

51
52
53
54
55
56
57

58
59
60
61
62
63
64
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
832
833
834
835
836
837
838


839
840
841
842
843
844
845
  Version 1.16
  - fixed issue when changing the current application with Alt+Tab - see
    http://synopse.info/fossil/tktview?name=01395e5932
  - fixed compiler error when using the unit with runtime packages enabled
    (known compiler issue about string resources, referenced as E2201)
  - default modal dialog parent changed into any current active form

  - some aesthetical rendering changes and code clean-up (e.g. no temporary
    form necessary), thanks to uligerhardt proposals

}

interface

................................................................................
  // tdfUseCommandLinksNoIcon, and tdfQuery options
  TTaskDialogFlag = (
    tdfEnableHyperLinks, tdfUseHIconMain, tdfUseHIconFooter,
    tdfAllowDialogCancellation, tdfUseCommandLinks, tdfUseCommandLinksNoIcon,
    tdfExpandFooterArea, tdfExpandByDefault, tdfVerificationFlagChecked,
    tdfShowProgressBar, tdfShowMarqueeProgressBar, tdfCallbackTimer,
    tdfPositionRelativeToWindow, tdfRtlLayout, tdfNoDefaultRadioButton,
    tdfCanBeMinimized, tdfQuery, tdfQueryMasked);

  /// set of available configuration flags for the Task Dialog
  TTaskDialogFlags = set of TTaskDialogFlag;

  /// implements a TaskDialog
  // - will use the new TaskDialog API under Vista/Seven, and emulate it with
  // pure Delphi code and standard themed VCL components under XP or 2K
................................................................................
        if tdfQuery in aFlags then begin
          Edit := TEdit.Create(Form);
          Edit.Parent := Par;
          Edit.SetBounds(X,Y,aWidth-16-X,22);
          Edit.Text := Query;
          if tdfQueryMasked in aFlags then
            Edit.PasswordChar := '*';


          inc(Y,42);
        end;
      // from now we won't add components to the white panel, but to the form
      Panel.Height := Y;
      Par := Form;
      // add buttons and verification checkbox
      if (byte(aCommonButtons)<>0) or (Verify<>'') or






>







 







|







 







>
>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
...
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
  Version 1.16
  - fixed issue when changing the current application with Alt+Tab - see
    http://synopse.info/fossil/tktview?name=01395e5932
  - fixed compiler error when using the unit with runtime packages enabled
    (known compiler issue about string resources, referenced as E2201)
  - default modal dialog parent changed into any current active form
  - added tdfQueryFieldFocused optional flag to focus the input field component
  - some aesthetical rendering changes and code clean-up (e.g. no temporary
    form necessary), thanks to uligerhardt proposals

}

interface

................................................................................
  // tdfUseCommandLinksNoIcon, and tdfQuery options
  TTaskDialogFlag = (
    tdfEnableHyperLinks, tdfUseHIconMain, tdfUseHIconFooter,
    tdfAllowDialogCancellation, tdfUseCommandLinks, tdfUseCommandLinksNoIcon,
    tdfExpandFooterArea, tdfExpandByDefault, tdfVerificationFlagChecked,
    tdfShowProgressBar, tdfShowMarqueeProgressBar, tdfCallbackTimer,
    tdfPositionRelativeToWindow, tdfRtlLayout, tdfNoDefaultRadioButton,
    tdfCanBeMinimized, tdfQuery, tdfQueryMasked, tdfQueryFieldFocused);

  /// set of available configuration flags for the Task Dialog
  TTaskDialogFlags = set of TTaskDialogFlag;

  /// implements a TaskDialog
  // - will use the new TaskDialog API under Vista/Seven, and emulate it with
  // pure Delphi code and standard themed VCL components under XP or 2K
................................................................................
        if tdfQuery in aFlags then begin
          Edit := TEdit.Create(Form);
          Edit.Parent := Par;
          Edit.SetBounds(X,Y,aWidth-16-X,22);
          Edit.Text := Query;
          if tdfQueryMasked in aFlags then
            Edit.PasswordChar := '*';
          if tdfQueryFieldFocused in aFlags then
            Form.ActiveControl := Edit;
          inc(Y,42);
        end;
      // from now we won't add components to the white panel, but to the form
      Panel.Height := Y;
      Par := Form;
      // add buttons and verification checkbox
      if (byte(aCommonButtons)<>0) or (Verify<>'') or