38 Commits

Author SHA1 Message Date
5a8a4af29a Rename helpers unit to apphelpers, to overcome a naming conflict with the FireMonkey unit FMX.Canvas.GPU.Helpers. Closes #102. 2018-01-22 19:48:17 +01:00
5837689c71 No need to adjust vertical position of OK button on sorting popup. See http://www.heidisql.com/forum.php?t=12980 2013-07-07 04:27:11 +00:00
f96288fce9 Translate string variables and literals in .pas files. TODO: translate constants. 2012-11-26 05:44:01 +00:00
ca1d94c87b Issue #557: Include gnugettext.pas from https://dxgettext.svn.sourceforge.net/svnroot/dxgettext/trunk/dxgettext/sample/ . And add basic code to all FormCreate events to translate their components in the future. 2012-11-10 14:28:44 +00:00
5e8bf8306a Remove unused unit inclusions, detected by CNPack/Uses cleaner 2012-05-01 08:34:12 +00:00
535bcc3470 Fix "abstract error" when clicking "delete" button on data sorting dialog, caused by free'd button in its OnClick event. 2012-02-14 18:30:10 +00:00
be645ac79b Unify code for refreshing Virtual Trees in a new helper method InvalidateVT. Fixes issue #1789 and issue #1790.
* Don't try to access a passed tree if it has been destroyed by some earlier event.
* Don't try to access registry in DoDisconnect after key has been closed.
* Now that DoDisconnect lives in FormDestroy it is save to call it slightly earlier, before registry has been closed. There should be no later paint events which will trigger random database queries.
2010-03-21 10:43:16 +00:00
458b4c3acf Introduce a more simple strategy in data tab grid for loading data:
* Load in OnBeforePaint, if the tree's tag is set to NOTLOADED
* Load 1,000 rows in one step, up to a maximum of 100,000 rows. Both values are customizable.
* Load next chunk when user presses PageDown on the last node, or, more explicitly, when user clicks "Next rows" button
* Should fix all AVs which seem to be a timing issue with loading data on demand.
* Fixes issue #1675, fixes issue #1580, fixes issue #1721, fixes issue #1734, fixes issue #972
2010-03-01 16:44:36 +00:00
b43b44ee5a Columns of selected datagrid object can also come from a view, so ParseTableStructure is not sufficient in both data sorting and column selection forms. Instead, just use mainform's lists which are exactly what we need. Fixes issue #1611. 2010-01-19 22:49:18 +00:00
9080ad7607 No need to use the Wide* version of string functions any longer. 2010-01-15 20:28:48 +00:00
52ea8f410a Use Unicode enabled TStringList instead of TWideStringList in all places. Should have no visible effect, apart from a very minor performance optimization, as String reference pointers are handled by Delphi, WideString by Windows. 2010-01-14 19:41:58 +00:00
25ac096554 Make more use of Generics, this time for columns, keys and foreigne keys lists, used by main unit and table editor. Frees code from annoying casting and makes it more type safe. 2010-01-08 00:30:51 +00:00
7d401ffde8 Upgrade to Delphi 2010:
* Removes TNT Unicode controls, which are no longer required. All VCL controls now have native Unicode support.
* Remove Delphi 11 packages, otherwise we would either need to keep TNT or break Unicode
* PngComponents update from Uwe Raabe on http://cc.embarcadero.com/Item/26127
* Adjust auto build process
* Since Delphi 2009, Strings are now UnicodeStrings, not AnsiStrings any longer. Fix a bunch of compiler errors which came along with this change.
TODO: Project should compile but give tons of compiler warnings.
2010-01-05 23:14:33 +00:00
6c74af1ec8 Add a menu item "Reset sorting", to remove ORDER BY columns with one click / shortcut. Fixes issue #561. 2009-12-27 16:39:54 +00:00
e356cb7ed7 Sanitize all "uses" clauses from unneeded unit references. 2009-12-22 23:19:56 +00:00
43fe695bc1 Make SHOW KEYS FROM <selected-table> and SHOW COLUMNS FROM <selected-table> superfluous. To achieve that, move parser for SHOW CREATE TABLE string from table editor to helpers unit, where it can be called by everyone. For consistency reasons the index list in table editor is converted from a TWideStringList to a TObjectList, like both table and foreign key list. However, that results in a large diff here. 2009-12-04 21:20:06 +00:00
12a8e2ebc5 Implement a more lightweight connection layer, consisting of 2 units in source directory. Breaks threading and window to window communication, which should be reimplemented later. 2009-10-28 00:08:49 +00:00
358100d6b3 Fix issue #990: SQL error if switching from table to data view, if column to sort by has been deleted. Plus: fix relevant naming convention for property + field. 2009-06-06 19:42:20 +00:00
bc33729fdd Issue #436: Remove table tab from main tabs, and old field editor. Both were replaced by the new table editor. Doubleclicking a table opens the data tab now. 2009-05-17 16:02:28 +00:00
909d31fd64 Simplify writing settings to registry:
* Keep only one TRegistry object in memory instead of creating a new one in each routine.
* Move out relevant functions and TRegistry object from main to helpers to make them usable globally.
2009-01-03 17:16:11 +00:00
f1b3f5501f Remove last traces of MDI (issue #513). Merges code, controls and events from childwin into main. 2009-01-01 23:24:36 +00:00
a591edebac Fix bug #714: Impossible to change limit^H^H^H^H^H^H sort order by implementing a fourth button with dropdown menu, enabling the user to save all query elements in one settings. 2008-10-16 23:49:17 +00:00
9a52593dc2 Use Vista's Segeo font for all forms by using the SetVistaFonts() in mainform plus the new routine InheritFont() which simply overtakes fontname and size from the mainform to all other forms. 2008-08-29 18:20:14 +00:00
07d4f1c9d4 Fix (re)storing Unicode table and column names for the ORDER BY clause 2008-08-27 18:01:15 +00:00
6daf4b3f76 Fix most remaining Unicode unsafe GUI controls. 2008-08-25 20:24:00 +00:00
aabd4bbf57 Add some more support for databases and tables with unicode characters. 2008-08-08 19:32:24 +00:00
aa0bd953c6 Replace TNTDBGrids with VirtualTrees to enhance grid viewing and editing.
Affected issues: rfe #618, rfe #464, bug #324, bug #635 (maybe more)
Breaks: Unicode grid editing (due to yet unsolved bug #620), enum pulldowns, MEMO editing
Major changes:
  - editor tab at bottom completely removed, SQL log is always visible now.
  - memo, blob and enum editors don't have a replacement yet. This is left for later commits.
  - grid cells are colorized to signalize their datatypes
  - UPDATEs, DELETEs and INSERTs are composed by own code, no longer by Zeos internal mechanisms. Should make debugging easier.
  - UPDATEs + DELETEs on tables without unique key are blocked now.
  - editing in the query grid is always blocked. Would need some extensive parser to allow that.
2008-08-03 19:30:07 +00:00
d4e9386682 Work around bug #580 by converting the two TSpeedbuttons above the datagrid to toolbar buttons. This should stop the AV annoyance for these buttons. Not sure if we have the same issue still on other TPNGSpeedButtons as it's long ago I saw one. 2008-07-07 23:22:36 +00:00
efa71f50bb Implement automatic closing of data sorting + column selection dialogs when clicking elsewhere by catching the FormDeactivate event. (rfe #562 and rfe #579) 2008-06-23 19:49:11 +00:00
815eea1481 Rename childwin's "Description" property to "SessionName" which says more exactly what it really is. 2008-03-05 12:21:25 +00:00
4e23728aa2 - Move all hardcoded preferences names (registry) plus their default values to const.inc to fix inconsistencies like the one described here: http://www.heidisql.com/forum/viewtopic.php?p=1739
- Consequently use Mainform.GetRegValue() to read these values, an overloaded method with either Boolean, String or Integer result. These methods keep a global TRegistry object (regMain) open while the application runs, rather than creating a new one for each caller.
- Remove Mainform.SaveRegValue() which was used in one or two callers. Rather use a TRegistry object and do that by hand. There's no significant advantage in using a SaveRegValue method currently.
2008-02-06 00:00:52 +00:00
f6d4e637e3 Replace TSMDBGrid in Data + Query tabs by TTntDBGrid.
- Implement an alternative solution for handling sorted columns without usage of SMDBGrid's sortcolumns. Move relevant structures and functions from data_sorting.pas to childwin.pas and use them in both units.
- Upgrade some code parts to use WideStrings instead of Strings so they don't break with the new grid.
- Use Grid.OnDrawDataCell as an alternative to Grid.OnGetCellParams as the latter one is a feature of SMDBGrid
- Cosmetic: enhance screen real estate in viewdata()
2007-11-26 20:58:08 +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
9409c798ab Remove ActualDatabase and ActualTable variables, plus various minor optimizations that ensued from said change. Fixes a problem where when:
- viewing data in a table
 - switching to query tab
 - pressing master refresh
some of the tabs would disappear.
2007-09-11 15:58:47 +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
0f00d4a3c8 Enhancement: Disable the OK button in the new sorting dialog if there's no change to the old ORDER clause. Disabling that button should be the signal to the user that he didn't make any effective change yet. Helps forgetful people. 2007-07-14 18:51:27 +00:00
064ed3b4da Decide to refresh data if the OK button in any of the two dialogs (column_selection, data_sorting) was pressed. Don't call viewdata in the dialogs, but in ChildWin itself. Saves some superflous procedures / code. 2007-07-12 22:44:05 +00:00
cc84963b25 Implement a dialog for easier accessing the options for ordered columns.
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.
2007-07-12 22:33:59 +00:00