Commit Graph

129 Commits

Author SHA1 Message Date
Artur Wieczorek
8c187ffc7a Get rid of commented out and unused macro definitions 2019-06-16 19:45:39 +02:00
Artur Wieczorek
fde9bb6d41 Make wxPG_COLOUR_ALLOW_CUSTOM a Boolean property
So far it was implemented as property which could take int values 0/1 so it was acting essentially as a Boolean property. Implementing it explicitly as a Boolean one will make it more intuitive. Legacy code setting 0/1 int values shouldn't be affected because conversion from int to bool is implicit.
2019-05-12 20:24:57 +02:00
Artur Wieczorek
1b977718d4 Make wxPG_FILE_xxx built-in attributes
All wxPG_FILE_xxx attributes are used only in wxFileProperty to set respective internal data members and don't have to be stored in the property's attribute store.
2019-05-12 20:24:55 +02:00
Artur Wieczorek
96e24e73d6 Use conditional operator instead of conditional statement
This notation is more intuitive in this context.
2019-04-28 17:14:25 +02:00
Artur Wieczorek
50b1cfd0b5 Use dedicated function to change wxPGProperty flags
Using wxPGProperty::ChangeFlag() function makes the code simpler and more readable.
2019-04-28 16:38:48 +02:00
Artur Wieczorek
cbfff9c944 Set built-in attributes also for parent wxPGProperties
If given attribute is not a built-in attribute handled by the current property it should be passed to the parent property because it may be handled there.
2019-04-22 20:28:23 +02:00
Artur Wieczorek
cd1dafb619 Make wxPG_ATTR_MULTICHOICE_USERSTRINGMODE a built-in attribute
This attribute is used only internally in wxArrayStringProperty and thus can be considered as a built-in attribute which value can be stored in the local data member and not in the property's attribute store.
2019-04-22 20:16:15 +02:00
Artur Wieczorek
1ee97383f7 Make wxPG_COLOUR_HAS_ALPHA a built-in attribute
wxPG_COLOUR_HAS_ALPHA attribute is used only in wxSystemColourProperty (and derived properties) to set respective internal flag so it doesn't have to be stored in the property's attribute store.
2019-04-21 23:39:31 +02:00
Artur Wieczorek
76584e2d3c Use dedicated function to get rounded value of wxFloatProperty
wxFloatProperty::ValueToString() returns string representing value rounded with required precision so we don't need to retrieve wxPG_FLOAT_PRECISION attribute and do rounding on our own.
2019-04-21 23:39:29 +02:00
Artur Wieczorek
01e21b4f38 Use predefined constants to represent wxPGProperty attribute identifiers
Use predefined constants representing attribute identifiers instead of specific strings.
2019-04-21 23:39:25 +02:00
Artur Wieczorek
e6a7267811 Fix calculation of spin button size in wxSpinCtrl editor
Under GTK+ 3 wxSpinButton (being a part wxSpinCtrl editor) is always
displayed horizontally and its minimal width is greater than 18 pixels
so its best width has to be left unmodified and we can only attempt
to fit its height to the height of the wxSpinCtrl property cell.
For other ports wxSpinButton can be displayed vertically and scaled as
necessary.

Closes #18385.
2019-04-14 12:02:51 +02:00
Paul Cornett
fe1737d399 Reduce the scope of some local variables 2019-04-05 10:44:02 -07:00
Artur Wieczorek
e2115d0d6f Remove unneeded calls to c_str() 2018-11-10 20:44:54 +01:00
Artur Wieczorek
c606a7fc9f Store format as wxString
Using wxString here is simpler and not misleading.
2018-11-10 20:41:00 +01:00
Artur Wieczorek
7911d50335 Use locale-specific date format
There is no need to construct format string manually.
2018-11-10 20:39:57 +01:00
Stefan Csomor
4580cdb9ad Extending wxFont API & OSX Core Text Implementation (#877)
* Switch to pure Core Text Implementation, Start extended Font API

* mac fixes

* First msw implementation

* Fixing paste error

* fixing typo

* Rearranging lines to former fallthrough order

* Blind fixes for covering new abstract methods

* Blind gtk implementations

* Fixing according to travis ..

* Removing method defined in base

* formatting adaptions

* Extending the schema definition for new weights

* fixing typo, using wxRound, other fixes according to comments

* changes according to suggestions

* fixing init order, before the init of m_info was overridden by Init()

* redo

* redo

* redo

* Cleanup

Removing obsolete code snippets, proper traces for font names

* Moving common code

Only the Get/SetNumericWeight calls should now be implemented in the native part, the ‚old‘ Get/SetWeight are common code and use the numeric counterparts.

* Updating docs

* commit wa missing changes.txt

* Doc fixes

* Full stops added
2018-09-01 19:42:18 +02:00
Vadim Zeitlin
d4f380e16e Use Bind() instead of Connect() in wxWidgets code
Use more modern function which allows to avoid wxXXXEventHandler()
macros use.

No real changes.
2018-05-30 13:06:20 +02:00
Artur Wieczorek
0d30db33e1 Fix build failures on some platforms after 7be75892.
Add header files to have full declarations of wxMemoryDC and wxMetafileDC which are apparently necessary on some platforms for wxDynamicCast.
2015-11-29 09:25:19 +01:00
Artur Wieczorek
7be75892a3 Fixed drawing colours with alpha in wxSystemColourProperty (wxPG).
For systems which don't support drawing with alpha on standard DC (like e.g. Win, GTK2) there is necessary to use graphics context for this purposes.
2015-11-27 21:36:21 +01:00
Artur Wieczorek
363492e50b Fix initialization of custom colours for colour dialog in wxSystemColourProperty::QueryColourFromUser.
Use number of custom colours taken from wxColourData instead of using explicit numeric value.
2015-11-18 20:16:06 +01:00
Artur Wieczorek
17d5429276 Fix choosing custom colour with opacity in wxColourProperty (wxPG).
Invoke colour dialog with opacity option enabled when wxColourProperty is used with alpha support enabled (wxPG_COLOUR_HAS_ALPHA attribute is set).
2015-11-18 20:13:24 +01:00
Artur Wieczorek
79794391e9 Declare wxPG_DEFAULT_IMAGE_SIZE as wxDefaultSize constant.
wxDefaultSize is an equivalent of wxSize(-1,-1) but is more portable.
2015-07-15 21:45:27 +02:00
Artur Wieczorek
27032e71d2 Remove unused variable from wxFontProperty::wxFontProperty 2015-06-28 19:31:52 +02:00
Artur Wieczorek
06013ea36f Reduce the scope of variables using to index single loop only.
And adjust their types if necessary.
2015-06-06 17:55:39 +02:00
Jan van Dijk
72a4c3a4d0 Don't test if a reference is null, this cannot happen.
Testing for null references is unnecessary and just results in clang warnings.

Closes #17016.
2015-06-03 17:08:30 +02:00
Artur Wieczorek
67bfb78ace Replace wxT() with wxS() in wxPropertyGrid code. 2015-05-31 19:20:11 +02:00
Artur Wieczorek
0508087ce2 Reduce the scope of variables using to indexing single loop only.
And adjust their types if necessary (to have uniform types in the test expression).
2015-05-28 19:39:14 +02:00
Artur Wieczorek
a6bdfa7fd0 Use variable of type wxEventType to store the value returned by GetEventType function.
Since wxEvent::GetEventType() returns wxEventType value the variable used to hold returned value should be also of the same type.
2015-05-26 21:13:13 +02:00
Artur Wieczorek
08f9e27351 Added some hints for translators in wxPG.
Because context of some texts to be translated can be unclear added some instructions for translators which can be extracted by gettext or similar tools.
2015-05-16 17:06: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
Artur Wieczorek
7c6943175b Prepare wxPG to build successfully when wxUSE_LONGLONG or wxUSE_DATETIME is disabled.
Make the code ready to build even when wxLongLong and wxDateTime types are not available.
2015-04-03 21:12:54 +02:00
Artur Wieczorek
4e7fbd4e92 Use predefined constants to represent wxPG variant types.
Instead of using individual string literals use globally defined constants representing wxPG variant types.
2015-03-29 21:42:58 +02:00
Artur Wieczorek
5353a00180 Use wxVariant::IsType() function to check the type of variant values in wxPG.
Since there is a dedicated function to check the type of variant then there is not necessary to call wxVariant::GetType() function and perform explicit comparisons of returned strings.
2015-03-29 21:41:52 +02:00
Artur Wieczorek
2f239930eb Avoid consecutive calls of wxVariant::GetType() in the multiple-branch conditional statements.
This is a minor optimization since wxVariant::GetType() is not a simple inline getter method.
2015-02-28 16:37:07 +01:00
Artur Wieczorek
35b53a8c30 Replace WX_PG_IMPLEMENT_PROPERTY_CLASS macro with simplified wxPG_IMPLEMENT_PROPERTY_CLASS macro.
New macro have no obsolete parameters and its name conforms to the naming standard (prefixed with wx).

Closes #15541

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-04 16:46:34 +00:00
Artur Wieczorek
3100258aa1 Refactor wxPGSpinCtrlEditor.
Declare and use attribute constant instead of explicit string "MotionSpin".


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-21 16:59:46 +00:00
Artur Wieczorek
752938cecd Fix a hack implemented in wxEnumProperty::ValueFromString_ and wxEnumProperty::ValueFromInt_ functions.
wxEnumProperty code is refactored in order to fix a hack which purpose was (apparently) to bypass constness of these functions by caching determined indices in wxEnumProperty::ms_nextIndex static member variable for further processing. (Unclear concept of using this static member was referred in http://trac.wxwidgets.org/ticket/12779#comment:9)
Now, determined index is returned to the caller and processed there if necessary and hence caching of this index is not necessary.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 17:22:29 +00:00
Jouk Jansen
47ac6fbd59 Fix compilation for wxGTK1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-07 13:08:48 +00:00
Artur Wieczorek
72ecca770a Draw cursor image in wxCursorProperty using wxDC::DrawBitmap.
Since monochrome images are supported by wxBitmap (under MSW) there is no longer need to draw cursor image using native Win API.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-20 15:12:00 +00:00
Artur Wieczorek
53bb48808c Add drawing cursor images for wxCursorProperty under wxGTK.
Closes #16637

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-18 12:00:37 +00:00
Artur Wieczorek
c1741cf677 Use wxPropertyGrid::HasInternalFlag() function to check internal flags.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 19:57:47 +00:00
Artur Wieczorek
a3611b8190 Fix manual selection of custom colour item for wxColourProperty and wxSystemColourProperty in wxPG.
If keyword 'custom' is entered into the edit field of wxColourProperty or wxSystemColourProperty (with wxPGEditor_ComboBox) then dialog box to query for custom colour should be invoked. Afterwards, when control value is updated, its selection index should be also updated respectively.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 19:46:25 +00:00
Artur Wieczorek
44be806ac6 Use special code to identify custom colour in wxPG.
There is already defined a special code (wxPG_COLOUR_CUSTOM) to identify custom colour in wxColourProperty and wxSystemColourProperty but in practice item representing this colour is identified either by position (it is assumed it as always last item) or by fixed text label. This inconsistency makes the code unclear and can lead to problems (see workaround r76627).
Now, only wxPG_COLOUR_CUSTOM code is used to identify custom colour and hence "custom colour" item doesn't need to be the last item in the collection and doesn't need to have a fixed text label (like "Custom").


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 17:07:08 +00:00
Artur Wieczorek
facbd123c2 Check if colour database exists before trying to use it in wxColourProperty.
Sanity check in wxColourProperty ctor.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-12 16:07:54 +00:00
Artur Wieczorek
498dc8161c Allow use of all wxPG colours.
wxPG-specific colours are added to the colour database when wxColourProperty is created (already existing colours are not overwritten by wxPG ones).
Original list of wxPG colours was restored.

Closes #15597.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-12 10:47:15 +00:00
Artur Wieczorek
63a9cc4c2e Use automatically generated ID values for wxPG sub-controls.
Currently in wxPG there are used fixed "magic" ID values to identify sub-controls and this can lead to side effects if these values overlap with ID values assigned to another controls in the application (like e.g. menu items).

Closes #13634.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-09 18:56:36 +00:00
Vadim Zeitlin
89d16faf30 Fix cancelling choice of custom colour in wxPropertyGrid.
When using wxPGEditor_Choice colour property, cancelling the choice of the
custom colour reset the previously selected custom colour.

Fix this by correcting the test for the custom colour which didn't work
before.

Closes #15542.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-29 23:48:51 +00:00
Vadim Zeitlin
494c9c9b0b Avoid showing the colour selection dialog twice in wxPropertyGrid.
Selecting "Custom" in a colour property cell resulted in the colour selection
dialog being shown twice if it was cancelled the first time.

Fix this by using wxPG_PROPERTY_SPECIFIC to indicate that the value is just
being queried and the user shouldn't be asked to enter it, as it is already in
the other places.

Closes #15543.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-22 14:36:00 +00:00
Vadim Zeitlin
31b8c29fcd Fix bugs in wxEnumProperty introduced by r76562.
The compilation fixes introduced run-time fixes due to not account for the use
of NULL pointers (which are not accepted as choices cache but are accepted as
choices values, go figure).

Closes #16266.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-18 00:24:13 +00:00
Vadim Zeitlin
ebc6161c59 Compilation fixes to wxPropertyGrid after r76558.
We can't use _() in the static wxChar* arrays: first, because this doesn't
compile and second because if it did compile, it still wouldn't work as no
message catalogs are loaded yet when the static arrays are initialized.

Use wxTRANSLATE() instead and arrange for the strings to be translated when
they are really used. This is rather ugly and perhaps it would be better to
avoid passing untranslated labels array to the property classes but at least
the code compiles again now.

See #16266.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-17 13:41:27 +00:00