18 Commits

Author SHA1 Message Date
aabd4bbf57 Add some more support for databases and tables with unicode characters. 2008-08-08 19:32:24 +00:00
41074d211e Convert database tree from TTreeView to TVirtualStringTree.
- Fixes bug #271 "F5 shortcut in database tree not working"
- Fullfills rfe #519 "Highlight selected item in tree view when focus is elsewhere"
- Fixes inconsistent expansion state of nodes after refreshing
- Fixes plus sign staying when a db node with 0 tables was selected
- Slightly enhances painting speed within the dbtree
- Removes temporary storage of a rightclicked node (DBRightClickSelectItem). VirtualTree handles its right clicked selection exactly like the left clicked one, which makes makes coding a bit cleaner as we can always use the selected item instead of hacking with the right and left clicked node. On the other side it removes a quite user friendly feature. Well, we can reimplement this feature later, though it's not user UNfriendly currently.
- Reasonably rename the StringList "OnlyDBs" to "DatabasesWanted" and "OnlyDBs2" to "Databases"
2008-06-13 23:05:51 +00:00
d0a0a22443 Display sizegrip in the lower right corners of all resizable forms which have no TStatusbar. (For copyright notices see code in helpers.pas) 2008-05-12 17:55:06 +00:00
10ea69ab93 Try to fix bug #1931387 "Hangs on large number of tables". Plus: Remove "find" parameter from PopulateTreeTableList procedure as that was used only once and there only to pass SelectedTable. 2008-04-05 11:34:48 +00:00
5fbee3c690 Make selection of table engine available on pre 4.1 servers. Applies to "Alter table" dialog as well as "Create table".
- Use variables like "have_innodb" for detection of supported engines.
- Move redundant code from two places to Childwin.TableEnginesCombo()
- Remove some legacy code around this logic
- Don't free the instance of CreateTableForm after closing it. Saves some SQL queries from being fired each time the form gets created.
2008-01-11 15:45:21 +00:00
e7bcbdf293 * Bugfix: plug the most obvious memory leaks.
* Clear some unused code and wrong comments.
2007-11-09 09:51:31 +00:00
5f86b11cad * Bugfix: The TTreeView component has a nasty habit of inserting a bad memory reference into TTreeView.Selected whenever TTreeView.ClearSelection() or TTreeView.Items.Clear() are called. The bad memory reference is in turn picked up by GetActiveDatabase and GetSelectedTable, which are used all over the place, making stuff like this fun to debug. Worked around by constructing a 'fake' db tree in memory, then prodding the TTreeNodes structure from that on top of the regular DB tree. Someone bothered to do a bit of serialization / deserialization magic in TTreeNodes.Assign, making this work beautifully.
* Bugfix: When methods are called recursively, they should push/pop altered event handlers on a LIFO stack instead of blindly setting and unsetting them.

* Cosmetic: Reclaim screen real estate in ReadDatabasesAndTables().
2007-11-07 07:02:10 +00:00
a13f4d65f9 Adjust popupTreeView:
- Add "Alter table ..." command, according to popupDbGrid
- Minor case spelling ("Table" -> "table")
2007-10-02 19:22:10 +00:00
69572e38a7 Create once and then cache tbl_properties_form when it's needed. Avoids querying COLLATIONS and ENGINES each time the form gets displayed. 2007-09-24 20:04:46 +00:00
6a36dbf83f Minor fix for rev 944: Don't add auto_increment to ALTER statement if it was empty (was silently converted to "0"). 2007-09-24 20:02:39 +00:00
b9155a63ef Minor: Give a menuitem a prettier name. 2007-09-24 19:57:41 +00:00
d69d81a4b1 Renovate "Advanced properties" dialog:
- Drop pagecontrol to access more than one selected table. Didn't seem helpful for any case, looked ugly and was a click hell to use.
- Implement changeable editors for table name, comment, engine, charset, collation and auto_increment value.
- Backward compatibility kept: A 3.23.58 server leads to disabling editors for engine, charset and collation while keeping the others working.

A table's charset and collation can now be provided at creation time and at altering time. Just as it's implemented for databases. Fullfills now most of the wishes in RFE #1693393.
2007-09-24 19:56:16 +00:00
2d20176554 Convert last TSortListView to standard TListView, so we can nuke TSortListView completely from our components list.
The ListView in tbl_properties won't support sorting by columnclicking any longer, but that was useless with such a small amount of items anyway.

Further finetuning of list:
- Disable column-click
- Avoid animation on columns + items creation
- Autosize columns correctly
- Refactor WITH .. DO statements
2007-09-05 09:03:08 +00:00
d095fdb7cb Revamp "Advanced table properties" dialog:
- Synchronize height of all listviews after moving the splitter on one page.
- Drop maximum dimensions of form.
- Store/restore form and list dimensions via registry
- Documentation
- Simplify code
- Add useful popupmenu with items "Copy" + "Select all" to SynMemos which display the CREATE statements
- Rely on modalresult of form, drop OnClick handler of Close-button
- Format sum of table sizes using FormatByteNumber instead of always using KB as the unit of choice.
- Add a statusbar to the form to signalize that the form can be resized.
2007-09-03 13:59:29 +00:00
3f0b70c409 Switch ListColumns from TSortListView to TVirtualStringTree
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.
2007-08-27 00:01:53 +00:00
9068f08609 Convert ListTables from TSortListview to TVirtualStringTree
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
2007-08-25 00:08:31 +00:00
45d617c776 Move creation of tbl_properties_form from application startup to a place where it's done on demand.
Also removes a legacy procedure where that form was called, which is not linked to any control event.
2007-07-03 19:10:45 +00:00
3c8f123a81 Move *.pas, *.dfm and *.inc files from root directory to a new "source" subdirectory. Leaving just the readme in the root to give all newbies a very clear and unique starting point. 2007-06-28 20:00:04 +00:00