- Create the snippets folder if it's not present and user clicks on "Explore .."
- If no snippets exist, disable the menuitems "Insert at cursor", "Load" and "Delete"
This is the first VST and therefore some base procedures are added which can be reused for most other coming VT's:
- vstGetNodeDataSize
- vstGetText
- vstGetImageIndex
- vstHeaderClick
- vstCompareNodes
All these procedures should normally get linked to other VST's. Only the OnInitNode procedure cannot be reused, as it contains references to the data of the VST's nodes.
I hope the billions of options in this VST object make sense.
Left for later:
printlist.pas cannot process this list without changes. I will rewrite that as soon as all 5 lists are switched to VST.
Bugfix: Hiding tabs causes the active tab to switch implicitly. Move code that depends on the active tab to happen before tabs are hidden.
Change: Don't switch away from query tab when switching tables etc.
* Hide new menuitems when SynMemoFilter is focused.
* Call SynMemoQuery.OnChange in popupQuery.Popup to ensure various menuitems are dis-/enabled
* Disable "Clear" item when memo is empty
* Bring items in a better, usable order
* Nuke dependency of hardcoded itemcount in code for SQL functions: "popupQuery.Items[i+13].Add(mi);"
* Add useful actions:
+ Insert file at cursor
+ Save selection to file
+ Save as snippet
+ Save selection as snippet
* Assign procedures for menuLoad + menuSave at designtime, not at runtime (which made sense in a MDI mechanism)
* Minor optimization of detecting selected text in SynMemo
1. When user opens a file which is bigger than LOAD_SIZE (currently 5M), ask what to do
2. User can normally open the file, cancel, or use the new mechanism:
3. Load a chunk of LOAD_SIZE of SQL into memory
4. Split chunk with parseSQL into single queries
5. Run queries and go on with 3.
parseSQL is the bottleneck here, very CPU consuming, as it has to take care of different comment-styles and delimiters. So, the above strategy effected a good compromise regarding overall performance on different tests with worst case SQL files:
- "Wide" table exports with many big sized fields => long lines
- "Narrow" table exports with only one mini-sized field, extended INSERTs => short lines
Especially in the latter case it avoids to cause a hellfire of parseSQL-calls
Still seems to have some memory leaks somewhere.
Bugfix: FetchActiveDb...() is a helper function, do not try to handle exceptions as it leads to AVs.
Bugfix: ShowTableProperties() is a helper function, do not try to handle exceptions as it leads to AVs.
Bugfix: AV in ShowProcessList when disconnected.
Bugfix: AV in ShowVariablesAndProcesses when disconnected. (Something tells me it could be better to let the default for HandleErrors be 'false', a lot of these seems to pop up during testing...)
Bugfix: Connected time counter did not stop when connection got dropped.
Bugfix: Uptime counter did not stop when connection got dropped.
viewdata(): Use standard method of fetching data to get rid of redundant code.
...BeforeSendingSql(): Remove now redundant code.
Side-effect: Needed to change some editor-related shortcuts so they don't trigger their corresponding menu-commands from popupTableGrid when the user presses them at the time the column name gets edited:
- Call field editor : Now "Alt+Enter", was "Enter"
- Drop field : Now "Ctrl+Del", was "Del"
This has one positive side effect: ViewData no longer re-saves an ORDERCLAUSE to registry after it has been read. At the same time the ORDERCLAUSE is read everytime when grid is filled, not only the first time. Those changes were needed to be able to apply an ORDERCLAUSE which was generated and saved by the new dialog.
Left for later: Moving order-columns up and down. Tested that with a TUpDown which seems to ignore clicks sometimes and then doesn't fire OnClick.