Additionally/Sideeffects:
- Fix vstFreeNode to delete the item from the array, not only free the item itself
- Change/Rename GetSelectedNodesFromVT to GetVTCaptions and give it the ability to return all captions, not only the selected. This function is very useful now and saves writing much redundant code.
A table with 500 columns needed 3 seconds to display in the TSortListView, now that takes less than a half second.
Also checking the focused node doesn't say if some nodes are selected. A focused node can even be unselected in the way that its background is not highlighted. So, rather check the selection in ValidateControls.
Now the lists take all room they can get (alClient), which makes the workaround superflous. However, that made it necessairy to group the toolbars on a TPanel and set the TPanel to alLeft.
Additionally/Side effects:
- TVTreeData structure moved to helpers.pas to be able to use it in new function GetSelectedNodesFromVT.
- ListTablesEditing dropped. We don't need to disable any shortcut there because there is none set.
- Avoid potential AVs when accessing not created items in TVTreeData.Captions
- Don't replace "ListProcessesSelectItem" by "ListProcessesClick". Do the menuitem stuff in popupHost.popup()
- Avoid potential AV when exceeding the captions-list of a node in GetNodeText.
- 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"