AnyDAC
ContentsIndexHome
PreviousUpNext
GUI Questions

The list of questions and answers related to the AnyDAC GUI.

Group
Links
QU1: How to show "Application is busy" dialog, while the long running query is executing ?

A: Set ADQuery.ResourceOptions.CmdExecMode to amCancelDialog, drop TADGUIxAsyncExecuteDialog to a form, then prepare test to run long running query and run it. 

While the query is executing, AnyDAC will show a small dialog with the "Wait" label and the "Cancel" button. If user will press the button, then the query execution will be canceled. 

 

QU2: How localize the ADGUIxFormsLoginDialog ?

A: Use the code like that: 

 

with ADGUIxFormsLoginDialog1.VisibleItems do
begin
  Clear;
  Add('User_Name=<local phrase>');
  Add('Password=<local phrase>');
end;

 

Also, you will need to open uADStanResStrs unit, find there a section "// Dialog captions" and translate there the items. 

 

QU3: How to handle errors using TADGUIxErrorDialog ?

A: Just drop the TADGUIxErrorDialog component on your form or data module. Then for the EADDBEngineException unhanled exceptions the AnyDAC error dialog will be shown. To achieve that AnyDAC hooks the TApplication.OnException event. 

 

QU4: I see you are using syntax highlighting in the design-time editors. How I can do that on my workstation ?

A: You need to do following:

  • download appropriate for your Delphi version SynEdit archive. You can download SynEdit from da-soft site.
  • extract archive to some folder;
  • run Delphi IDE;
  • add <synedit>\Source folder to the Library Path;
  • open and install appropriate <synedit>\Packages\SynEdit_R<n>.dpk;
  • open and install appropriate <synedit>\Packages\SynEdit_D<n>.dpk;
  • if AnyDAC is not installed, then install it. Otherwise perform the following steps:
    • close Delphi IDE;
    • remove AnyDAC\Bin\_noSynedit.txt
    • goto AnyDAC\Bin folder;
    • run compileDXxxx.bat.

 

QU5: How can I turn off the SQL hourglass completely?

A: a) To disable wait cursor forever for an application. The uADGUIxConsoleWait unit contains an empty wait cursor implementation. So, including the uADGUIxConsoleWait into uses clause, no more wait cursor will be showed by AnyDAC. If a mouse cursor is still changing, then check, that only uADGUIxConsoleWait unit is included into your application and uADGUIxFormsWait is not included. Note, that you will not have an ability to turn wait cursor on again. 

 

b) To disable wait cursor, but to have ability later to enable it again. Use the code like that to turn off wait cursor: 

 

ADWaitCursor1.ScreenCursor := gcrNone;

 

or 

 

ADManager.ResourceOptions.SilentMode := True;

 

c) To disable wait cursor and AnyDAC dialogs, but to have ability later to enable it again. Set the ADManager.SilentMode property to True, then this will disable all wait cursors and AnyDAC dialogs, including:

  • error dialog
  • async execution dialog
  • login dialog
  • script progress dialog

Setting ResourceOptions.SilentMode to True, disables only wait cursors. 

 

QU6: When I apply filter to a dataset, grid scroll bar remains unchanged. Why it is so ?

Q: I have a have grid connected to ADDataSet. When I filter records like this: 

 

Grid.DataSource.Dataset.Filter := 'id_virtual_channel in (1, 2, 3)'

 

then everything is OK, but scroll bar remains unchanged like there would were all rows. It looks quite bad when for example full grid has 500 rows and filtered only 3 but scroll bar cursor stays very small and you can move it only a very litle (like from first to third row in 500).Do you have some solution? 

 

A: Use the code like that: 

 

ADQuery1.FetchOptions.RecordCountMode := cmVisible;

 

QU7: After refreshing a dataset a DBGrid with multiple selected rows looses the selection. How to preserve selection ?

A: AnyDAC bookmarks are invalidated after a Refresh call. You can save PK values of the selected records before Refresh call, then reselect these record again using Locate.

What do you think about this topic? Send feedback!