Commit Graph

143 Commits

Author SHA1 Message Date
Artur Wieczorek
3bf082a8e5 Fix preparing a bitmap in propgrid sample
Set explicitly the background colour before clearing the bitmap.
2019-10-02 00:08:25 +02:00
Artur Wieczorek
b06a9d227f Replace wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes with wxPG_DIALOG_TITLE
Current wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes can be used to customize editor dialog titles only for wxFileProperty and wxDirProperty, respectively. New wxPG_DIALOG_TITLE property is applicable to all properties derived from wxEditorDialogProperty so not only editor dialog titles for wxFileProperty and wxDirProperty can be set but also for wxFontProperty, wxLongStringProperty, etc.
wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes are marked obsolete.
2019-08-04 20:20:19 +02:00
Artur Wieczorek
69632371e3 Implement wxNumericProperty as a base class for all wxPG numeric properties
All numeric properties (wxIntProperty, wxUIntProperty, wxFloatProperty) share some features (like specific attributes, numeric validation, SpinCtrl editor support) so for the sake of clear design it would be good to derive them from the common base class (wxNumericProperty) in which all shared functions are implemented. This class is not intended to be instantiated so it's an abstract class.
2019-06-29 11:13:13 +02:00
Artur Wieczorek
50330b3a26 Use long int literals to represent long constants in propgrid sample 2019-05-26 18:52:43 +02:00
Artur Wieczorek
fa35fdc600 Preserve header and label editing mode while recreating the grid
For some operations when grid needs to be recreated currently selected options to show the header and to enable label editing are being ignored and it can be seen a discrepancy between the options selected (and shown) in the menu and the mode of just created wxPropertyGrid. To avoid this inconsistency respective flags can be stored and used to enable/disable features in just created grid.
2019-04-27 22:10:47 +02:00
Artur Wieczorek
0c144f6cda User proper value type of wxPG_ATTR_MULTICHOICE_USERSTRINGMODE attribute
This attribute is of int type.
2019-04-22 20:16:16 +02:00
Artur Wieczorek
d0a84a6266 Update some strings and labels to the more current values in propgrid sample 2019-04-21 23:39:36 +02:00
Dummy
b0660cc87c Pass argument of proper type to wxPropertyGridInterface::SetPropertyBackgroundColour
The last argument passed to this function should be an int flag not a Boolean value.
Boolean value 'true' passed here is converted to int 1 so wxPG_RECURSE flag is never set and the background colour is never changed for sub-properties.

Closes #18333.
2019-01-23 20:08:57 +01:00
Artur Wieczorek
8dbe6ec69d Add to propgrid sample an option to change virtual width of the grid 2018-12-27 13:16:41 +01:00
Artur Wieczorek
79b71cf4ff Scale bitmap to wxPropertyGrid's row height
By design only bitmaps lower than row height are displayed within the cells.
Because on every platform default row height can vary so bitmap has to be explicitly scaled to the row height to ensure that it will be initially displayed on every platform.

Closes #18310.
2018-12-24 00:00:14 +01:00
Blake Eryx
65827a0572 Remove unnecessary c_str() calls from the samples
Pass wxStrings directly to wxString::Format("%s") and similar
pseudo-vararg functions, there is no need for c_str() there since
wxWidgets 2.9.

Closes https://github.com/wxWidgets/wxWidgets/pull/1009
2018-11-03 22:52:57 +01:00
Artur Wieczorek
028cfb1ba4 Refresh wxPropertGrid after resetting the status
This is to visualize the effect of the modification.
2018-10-13 23:33:27 +02:00
Blake Eryx
4fb39beae1 Remove all wxS() macros from samples
The use of wxS() is an optimization which can be used to avoid an
implicit conversion from narrow to wide strings, but such optimizations
are not really needed in the samples and just make their code less
readable, so remove them.

Closes https://github.com/wxWidgets/wxWidgets/pull/956
2018-10-01 13:55:42 +02:00
Blake Eryx
b70ed2d8c8 Remove more wxT() macros from samples
Also use wxString instead of wxChar* strings.

Closes https://github.com/wxWidgets/wxWidgets/pull/950
2018-09-29 17:16:12 +02:00
Artur Wieczorek
54c5584c65 Don't set column title if wxPG header is going to be hidden
wxPropertyGridManager::SetColumnTitle() shouldn't be called when we going
to hide the header because it makes the header visible.
2018-07-07 20:29:37 +02:00
Vadim Zeitlin
5f7a6bd15b Replace Connect() with Bind() in all samples and utils too
Still use Connect() in unit tests which were written explicitly for it
and in EventConnector, which can't use Bind() as it uses a variable for
the event type.

No real changes, just use the newer and more convenient function.
2018-05-31 16:19:23 +02:00
Maarten Bent
a96171def4 Fix unused variable and parameter warnings in samples
These variables are only used in debug builds, causing warnings in release builds.
2017-11-25 17:52:08 +01:00
Artur Wieczorek
2f3376c4c5 Allow changing wxPG_EX_ALWAYS_ALLOW_FOCUS in propgrid sample
Add wxPG_EX_ALWAYS_ALLOW_FOCUS to the list of flags which can be changed.
2017-10-18 22:57:39 +02:00
Artur Wieczorek
19dbdca53b Rely on native double buffering by default in propgrid sample
If the platform has native double-buffering, create wxPropertyGrid
relying on it by default.
2017-10-18 22:56:44 +02:00
Artur Wieczorek
afdb7eca87 Use quotes and not angle brackets around the includes of wxWidgets itself 2017-07-16 18:31:54 +02:00
Artur Wieczorek
51f7074caf Fix MSVC14 warnings about a shadowed variable in the propgrid sample.
Just to suppress some harmless warnings.
2016-02-18 18:46:45 +01:00
Vadim Zeitlin
d66289dc95 Don't use the standard OS X Cmd+Q accelerator in the samples
Or, more precisely, don't use for anything else than exiting the application.

Closes #4326.
2016-02-01 16:03:31 +01:00
Artur Wieczorek
d0eea355fa Fixed turning on/off 'Category Specific Colours' in propgrid sample.
When specific colours are turned on then custom colours are assigned to both category properties and their sub-properties. But when specific colours are turned off then only category properties are reverted to default colours what is misleading.
Now, all properties are reverted to default colours.
2015-08-27 19:16:29 +02:00
Artur Wieczorek
503c6a48c7 Use argument of proper type when calling SetPropertyTextColour in propgrid sample.
wxPropertyGridInterface::SetPropertyTextColour expects int value for flags parameter, not Boolean.
2015-08-27 19:06:46 +02:00
Artur Wieczorek
0870f213df Do not attempt to change colours of properties which are not present on the current page (in propgrid sample).
Test executed from 'Category Specific Colours' menu is designed to work only for specific category properties which are present only on 'Standard Items' page.
Display a message if current page is not this one and therefore test cannot be executed properly. Also make menu item non-checkable if it is accessed from improper page.
2015-08-27 19:05:15 +02:00
Artur Wieczorek
e90feaadf3 Added ability to disable label editing mode in propgrid sample.
Currently, once label editing is enabled it cannot be disabled. By replacing ordinary menu item with check item and modifying the handler respectively, label editing mode can be switched on and off.
2015-08-19 19:42:44 +02:00
Artur Wieczorek
c5d6f9d103 Improved retrieving bitmaps from wxArtProvider in propgrid sample.
Retrieve from wxArtProvider bitmaps of required size instead of rescaling them in the application.
2015-08-08 22:27:23 +02:00
Vadim Zeitlin
e70d597c2e Fix propgrid sample compilation.
Resolve ambiguity in assignment of wxImage to wxBitmap in wxMSW which also has
wxBitmap::operator=(wxCursor). This should allow the sample to compile under
MSW after the changes of 1fce152d3c.
2015-07-02 17:07:32 +02:00
Artur Wieczorek
22cc1736ab Add the demonstration of wxEnumProperty with value bitmap to propgrid sample. 2015-06-29 00:04:47 +02:00
Artur Wieczorek
1fce152d3c Use wxArtProvider bitmaps to demonstrate wxEnumProperty with bitmaps in propgrid sample.
Use predefined bitmaps instead of drawing custom ones.
2015-06-28 19:31:45 +02:00
Artur Wieczorek
eaad15eb45 Use no-empty bitmaps to demonstrate wxEnumProperty with variable height bitmaps in propgrid sample.
Default blank black bitmaps look as damaged and this can be confusing.
2015-06-26 19:05:50 +02:00
Artur Wieczorek
4228e3210f Use pre-increment/decrement operators to move iterator in the loop (propgrid sample).
When the return value is ignored, the ++it/--it is never less efficient than the it++/it--.
2015-06-26 18:15:45 +02:00
Artur Wieczorek
a1c888437d Use dedicated IncBy method to increase wxSize value in propgrid sample.
Use this method instead of modifying directly wxSize data members.
2015-06-14 17:10:28 +02:00
Artur Wieczorek
6d29584b48 Use wxLogDebug instead of wxLogMessage to log column resizing with splitter in propgrid sample.
wxLogMessage displays message in pop-up window what prevents dragging the splitter and hence resizing cannot be in practice done. wxLogDebug is sufficient for the logging purposes in this place.
2015-06-13 22:39:16 +02:00
Artur Wieczorek
5d763571b0 Use pre-increment operator to increment iterator in the loop (propgrid sample).
When the return value is ignored, the ++it is never less efficient than the it++.
2015-06-13 22:32:14 +02:00
Artur Wieczorek
8ff74b727a Fixed minor typos in comments and strings in propgrid sample. 2015-06-13 22:28:28 +02:00
Artur Wieczorek
e4023cccc1 Removed unused identifier from propgrid sample. 2015-06-13 22:25:48 +02:00
Artur Wieczorek
8d9a9e286b Replaces references to wxT("") with wxEmptyString in propgrid sample. 2015-06-04 22:53:30 +02:00
Artur Wieczorek
9c9f80223b Exclude header demonstration in propgrid sample when wxUSE_HEADERCTRL == 0.
Code responsible for header demonstration should be excluded in this case because header management functions in wxPropertyGridManager depend on wxHeaderCtrl (via wxPGHeaderCtrl) and if it is not present then respective methods in wxPG are not exposed.
2015-05-31 19:20:17 +02:00
Artur Wieczorek
6299874971 Use wxSizerFlags when constructing sizers in propgrid sample.
Use it instead of multiple argument wxSizer::Add() overload.
2015-05-30 18:33:25 +02:00
Artur Wieczorek
a0157b37f2 Use wxVariant::IsType() function to check the type of variant values in propgrid sample.
Use this dedicated function to check the type of variant value instead of calling wxVariant::GetType() function and performing explicit comparisons of returned string.
2015-05-10 20:22:40 +02:00
Artur Wieczorek
cc799c10ac Use wxT macro with string literals in propgrid sample.
This fix is to unify string literals in the sample.
2015-05-10 20:21:37 +02:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Roberto Perpuly
69005ef145 Add to propgrid sample the option to select the way Boolean values are rendered.
This option is useful to demonstrate how to globally change the way Boolean values are rendered (either as check boxes or selection lists).

See #16922.
2015-04-04 10:19:31 +02:00
Artur Wieczorek
1638644ea6 Relocate "Run test" menu items in the menu of propgrid sample.
Move "Run test" menu items from "Try These!" menu to "File" menu in propgrid sample. It seems to be more adequate location for such action items.
2015-04-04 00:42:31 +02:00
Artur Wieczorek
726a5e1155 Prepare propgrid sample to build successfully when wxUSE_LONGLONG is disabled.
Make the code ready to build even when wxLongLong type is not available.
2015-04-03 21:14:06 +02:00
Artur Wieczorek
3e62d33935 Update composite wxStringProperty labels and values in propgrid sample.
Set some strings and labels to the more current values.
2015-03-31 19:14:36 +02:00
Artur Wieczorek
e4ea660dfd Fix minor typo in string macro in propgrid sample. 2015-03-29 21:37:33 +02:00
Artur Wieczorek
eb7979d25e Prevent assertion warnings in propgrid sample when "Test ReplaceProperty" is invoked more then once.
New property replacing the old one should have unique name to prevent assertion warning in wxPropertyGridInterfcae::ReplaceProperty when there is checked if property of a given name already exists.
2015-03-28 21:27:06 +01:00
Artur Wieczorek
7b8da40c8e Display additional information for EVT_PG_SELECTED event in propgrid sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-15 23:26:42 +00:00