Refactor wxButton and wxToggleButton to derive from wxAnyButton.

Introduce wxAnyButton class, a common base class for wxButton and
wxToggleButton, allowing to reuse the same implementation for them.

This also allows to implement support for bitmaps in wxToggleButton for all
platforms and make wxBitmapToggleButton a trivial subclass of it everywhere,
similarly to wxBitmapButton and wxButton.

Closes #13198.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2011-06-14 13:00:42 +00:00
parent eaa9e06d92
commit b4354db179
44 changed files with 3374 additions and 2651 deletions

View File

@ -2810,6 +2810,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_GUI_HDR = \
wx/generic/listctrl.h \
wx/generic/statusbr.h \
wx/gtk/accel.h \
wx/gtk/anybutton.h \
wx/gtk/bmpbuttn.h \
wx/gtk/button.h \
wx/gtk/checkbox.h \
@ -2933,6 +2934,7 @@ COND_TOOLKIT_MSW_GUI_HDR = \
wx/generic/filepickerg.h \
wx/generic/fontpickerg.h \
wx/msw/accel.h \
wx/msw/anybutton.h \
wx/msw/app.h \
wx/msw/bitmap.h \
wx/msw/bmpbuttn.h \
@ -3055,6 +3057,7 @@ COND_TOOLKIT_MSW_GUI_HDR = \
COND_TOOLKIT_OSX_CARBON_GUI_HDR = \
wx/html/webkit.h \
wx/osx/accel.h \
wx/osx/anybutton.h \
wx/osx/app.h \
wx/osx/bitmap.h \
wx/osx/bmpbuttn.h \
@ -3160,6 +3163,7 @@ COND_TOOLKIT_OSX_CARBON_GUI_HDR = \
COND_TOOLKIT_OSX_COCOA_GUI_HDR = \
wx/html/webkit.h \
wx/osx/accel.h \
wx/osx/anybutton.h \
wx/osx/app.h \
wx/osx/bitmap.h \
wx/osx/bmpbuttn.h \
@ -3269,6 +3273,7 @@ COND_TOOLKIT_OSX_COCOA_GUI_HDR = \
COND_TOOLKIT_OSX_IPHONE_GUI_HDR = \
wx/html/webkit.h \
wx/osx/accel.h \
wx/osx/anybutton.h \
wx/osx/app.h \
wx/osx/bitmap.h \
wx/osx/bmpbuttn.h \
@ -3458,6 +3463,7 @@ COND_TOOLKIT_WINCE_GUI_HDR = \
wx/generic/filepickerg.h \
wx/generic/fontpickerg.h \
wx/msw/accel.h \
wx/msw/anybutton.h \
wx/msw/app.h \
wx/msw/bitmap.h \
wx/msw/bmpbuttn.h \
@ -3832,6 +3838,7 @@ COND_USE_GUI_1_WXUNIV_1_GUI_CORE_HEADERS = \
COND_USE_GUI_1_ALL_GUI_HEADERS = \
wx/affinematrix2dbase.h \
wx/affinematrix2d.h \
wx/anybutton.h \
wx/bmpbuttn.h \
wx/brush.h \
wx/button.h \
@ -5320,6 +5327,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS = \
monodll_prntdlgg.o \
monodll_generic_statusbr.o \
monodll_fontdlgg.o \
monodll_gtk_anybutton.o \
monodll_artgtk.o \
monodll_gtk_bmpbuttn.o \
monodll_gtk_button.o \
@ -5444,6 +5452,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS = \
monodll_generic_statusbr.o \
monodll_prntdlgg.o \
monodll_msw_accel.o \
monodll_msw_anybutton.o \
monodll_artmsw.o \
monodll_msw_bmpbuttn.o \
monodll_msw_button.o \
@ -5498,6 +5507,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS = \
@COND_TOOLKIT_MSW@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_MSW___GUI_SRC_OBJECTS)
COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS) \
monodll_carbon_anybutton.o \
monodll_carbon_bmpbuttn.o \
monodll_carbon_button.o \
monodll_carbon_checkbox.o \
@ -5534,6 +5544,7 @@ COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS = \
@COND_TOOLKIT_OSX_CARBON@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS)
COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS) \
monodll_cocoa_anybutton.o \
monodll_osx_cocoa_button.o \
monodll_osx_cocoa_checkbox.o \
monodll_osx_cocoa_choice.o \
@ -5570,6 +5581,7 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS) \
monodll_regiong.o \
monodll_generic_icon.o \
monodll_iphone_anybutton.o \
monodll_iphone_button.o \
monodll_iphone_checkbox.o \
monodll_iphone_dialog.o \
@ -5679,6 +5691,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS = \
monodll_generic_statusbr.o \
monodll_prntdlgg.o \
monodll_msw_accel.o \
monodll_msw_anybutton.o \
monodll_artmsw.o \
monodll_msw_bmpbuttn.o \
monodll_msw_button.o \
@ -7244,6 +7257,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_1 = \
monolib_prntdlgg.o \
monolib_generic_statusbr.o \
monolib_fontdlgg.o \
monolib_gtk_anybutton.o \
monolib_artgtk.o \
monolib_gtk_bmpbuttn.o \
monolib_gtk_button.o \
@ -7368,6 +7382,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_1 = \
monolib_generic_statusbr.o \
monolib_prntdlgg.o \
monolib_msw_accel.o \
monolib_msw_anybutton.o \
monolib_artmsw.o \
monolib_msw_bmpbuttn.o \
monolib_msw_button.o \
@ -7422,6 +7437,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_1 = \
@COND_TOOLKIT_MSW@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_1)
COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_1 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_12) \
monolib_carbon_anybutton.o \
monolib_carbon_bmpbuttn.o \
monolib_carbon_button.o \
monolib_carbon_checkbox.o \
@ -7458,6 +7474,7 @@ COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_1 = \
@COND_TOOLKIT_OSX_CARBON@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_1)
COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_1 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_12) \
monolib_cocoa_anybutton.o \
monolib_osx_cocoa_button.o \
monolib_osx_cocoa_checkbox.o \
monolib_osx_cocoa_choice.o \
@ -7494,6 +7511,7 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_1 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_12) \
monolib_regiong.o \
monolib_generic_icon.o \
monolib_iphone_anybutton.o \
monolib_iphone_button.o \
monolib_iphone_checkbox.o \
monolib_iphone_dialog.o \
@ -7603,6 +7621,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS_1 = \
monolib_generic_statusbr.o \
monolib_prntdlgg.o \
monolib_msw_accel.o \
monolib_msw_anybutton.o \
monolib_artmsw.o \
monolib_msw_bmpbuttn.o \
monolib_msw_button.o \
@ -9352,6 +9371,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_2 = \
coredll_prntdlgg.o \
coredll_generic_statusbr.o \
coredll_fontdlgg.o \
coredll_gtk_anybutton.o \
coredll_artgtk.o \
coredll_gtk_bmpbuttn.o \
coredll_gtk_button.o \
@ -9476,6 +9496,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_2 = \
coredll_generic_statusbr.o \
coredll_prntdlgg.o \
coredll_msw_accel.o \
coredll_msw_anybutton.o \
coredll_artmsw.o \
coredll_msw_bmpbuttn.o \
coredll_msw_button.o \
@ -9530,6 +9551,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_2 = \
@COND_TOOLKIT_MSW@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_2)
COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_2 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_14) \
coredll_carbon_anybutton.o \
coredll_carbon_bmpbuttn.o \
coredll_carbon_button.o \
coredll_carbon_checkbox.o \
@ -9566,6 +9588,7 @@ COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_2 = \
@COND_TOOLKIT_OSX_CARBON@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_2)
COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_2 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_14) \
coredll_cocoa_anybutton.o \
coredll_osx_cocoa_button.o \
coredll_osx_cocoa_checkbox.o \
coredll_osx_cocoa_choice.o \
@ -9602,6 +9625,7 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_2 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_14) \
coredll_regiong.o \
coredll_generic_icon.o \
coredll_iphone_anybutton.o \
coredll_iphone_button.o \
coredll_iphone_checkbox.o \
coredll_iphone_dialog.o \
@ -9711,6 +9735,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS_2 = \
coredll_generic_statusbr.o \
coredll_prntdlgg.o \
coredll_msw_accel.o \
coredll_msw_anybutton.o \
coredll_artmsw.o \
coredll_msw_bmpbuttn.o \
coredll_msw_button.o \
@ -10936,6 +10961,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_3 = \
corelib_prntdlgg.o \
corelib_generic_statusbr.o \
corelib_fontdlgg.o \
corelib_gtk_anybutton.o \
corelib_artgtk.o \
corelib_gtk_bmpbuttn.o \
corelib_gtk_button.o \
@ -11060,6 +11086,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_3 = \
corelib_generic_statusbr.o \
corelib_prntdlgg.o \
corelib_msw_accel.o \
corelib_msw_anybutton.o \
corelib_artmsw.o \
corelib_msw_bmpbuttn.o \
corelib_msw_button.o \
@ -11114,6 +11141,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_3 = \
@COND_TOOLKIT_MSW@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_3)
COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_3 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_1_0) \
corelib_carbon_anybutton.o \
corelib_carbon_bmpbuttn.o \
corelib_carbon_button.o \
corelib_carbon_checkbox.o \
@ -11150,6 +11178,7 @@ COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_3 = \
@COND_TOOLKIT_OSX_CARBON@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_OSX_CARBON___GUI_SRC_OBJECTS_3)
COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_3 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_1_0) \
corelib_cocoa_anybutton.o \
corelib_osx_cocoa_button.o \
corelib_osx_cocoa_checkbox.o \
corelib_osx_cocoa_choice.o \
@ -11186,6 +11215,7 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_3 = \
$(__OSX_CARBON_COCOA_SRC_OBJECTS_1_0) \
corelib_regiong.o \
corelib_generic_icon.o \
corelib_iphone_anybutton.o \
corelib_iphone_button.o \
corelib_iphone_checkbox.o \
corelib_iphone_dialog.o \
@ -11295,6 +11325,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS_3 = \
corelib_generic_statusbr.o \
corelib_prntdlgg.o \
corelib_msw_accel.o \
corelib_msw_anybutton.o \
corelib_artmsw.o \
corelib_msw_bmpbuttn.o \
corelib_msw_button.o \
@ -12944,6 +12975,7 @@ COND_WITH_PLUGIN_SDL_1___sound_sdl___depname = \
@COND_PLATFORM_MACOSX_1@__PLATFORM_SRC_OBJECTS = monodll_apptraits.o
@COND_PLATFORM_UNIX_1@__PLATFORM_SRC_OBJECTS = monodll_apptraits.o
COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS = \
monodll_anybutton_osx.o \
monodll_bmpbuttn_osx.o \
monodll_button_osx.o \
monodll_checkbox_osx.o \
@ -13129,6 +13161,7 @@ COND_TOOLKIT_X11___ADVANCED_PLATFORM_SRC_OBJECTS = \
@COND_PLATFORM_MACOSX_1@__PLATFORM_SRC_OBJECTS_0 = monolib_apptraits.o
@COND_PLATFORM_UNIX_1@__PLATFORM_SRC_OBJECTS_0 = monolib_apptraits.o
COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_12 = \
monolib_anybutton_osx.o \
monolib_bmpbuttn_osx.o \
monolib_button_osx.o \
monolib_checkbox_osx.o \
@ -13314,6 +13347,7 @@ COND_TOOLKIT_X11___ADVANCED_PLATFORM_SRC_OBJECTS_0 = \
@COND_PLATFORM_MACOSX_1@__PLATFORM_SRC_OBJECTS_8 = coredll_apptraits.o
@COND_PLATFORM_UNIX_1@__PLATFORM_SRC_OBJECTS_8 = coredll_apptraits.o
COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_14 = \
coredll_anybutton_osx.o \
coredll_bmpbuttn_osx.o \
coredll_button_osx.o \
coredll_checkbox_osx.o \
@ -13411,6 +13445,7 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_4 = \
@COND_PLATFORM_MACOSX_1@__PLATFORM_SRC_OBJECTS_9 = corelib_apptraits.o
@COND_PLATFORM_UNIX_1@__PLATFORM_SRC_OBJECTS_9 = corelib_apptraits.o
COND_PLATFORM_MACOSX_1___OSX_CARBON_COCOA_SRC_OBJECTS_1_0 = \
corelib_anybutton_osx.o \
corelib_bmpbuttn_osx.o \
corelib_button_osx.o \
corelib_checkbox_osx.o \
@ -15766,6 +15801,9 @@ monodll_net.o: $(srcdir)/src/msw/wince/net.cpp $(MONODLL_ODEP)
monodll_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp
monodll_gtk_anybutton.o: $(srcdir)/src/gtk/anybutton.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/anybutton.cpp
monodll_artgtk.o: $(srcdir)/src/gtk/artgtk.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/artgtk.cpp
@ -16198,6 +16236,9 @@ monodll_tbarwce.o: $(srcdir)/src/msw/wince/tbarwce.cpp $(MONODLL_ODEP)
monodll_textctrlce.o: $(srcdir)/src/msw/wince/textctrlce.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/wince/textctrlce.cpp
monodll_carbon_anybutton.o: $(srcdir)/src/osx/carbon/anybutton.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/carbon/anybutton.cpp
monodll_carbon_bmpbuttn.o: $(srcdir)/src/osx/carbon/bmpbuttn.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/carbon/bmpbuttn.cpp
@ -16297,6 +16338,9 @@ monodll_carbon_tooltip.o: $(srcdir)/src/osx/carbon/tooltip.cpp $(MONODLL_ODEP)
monodll_carbon_window.o: $(srcdir)/src/osx/carbon/window.cpp $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/carbon/window.cpp
monodll_cocoa_anybutton.o: $(srcdir)/src/osx/cocoa/anybutton.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/anybutton.mm
monodll_osx_cocoa_button.o: $(srcdir)/src/osx/cocoa/button.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/button.mm
@ -16390,6 +16434,9 @@ monodll_osx_cocoa_tooltip.o: $(srcdir)/src/osx/cocoa/tooltip.mm $(MONODLL_ODEP)
monodll_osx_cocoa_window.o: $(srcdir)/src/osx/cocoa/window.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/window.mm
monodll_iphone_anybutton.o: $(srcdir)/src/osx/iphone/anybutton.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/anybutton.mm
monodll_iphone_button.o: $(srcdir)/src/osx/iphone/button.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/button.mm
@ -18976,6 +19023,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_msw_accel.o: $(srcdir)/src/msw/accel.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/accel.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monodll_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monodll_artmsw.o: $(srcdir)/src/msw/artmsw.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/artmsw.cpp
@ -19264,6 +19317,15 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monodll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monodll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monodll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monodll_bmpbuttn_osx.o: $(srcdir)/src/osx/bmpbuttn_osx.cpp $(MONODLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/bmpbuttn_osx.cpp
@ -21064,6 +21126,9 @@ monolib_net.o: $(srcdir)/src/msw/wince/net.cpp $(MONOLIB_ODEP)
monolib_sockosx.o: $(srcdir)/src/osx/core/sockosx.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/sockosx.cpp
monolib_gtk_anybutton.o: $(srcdir)/src/gtk/anybutton.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/anybutton.cpp
monolib_artgtk.o: $(srcdir)/src/gtk/artgtk.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/artgtk.cpp
@ -21496,6 +21561,9 @@ monolib_tbarwce.o: $(srcdir)/src/msw/wince/tbarwce.cpp $(MONOLIB_ODEP)
monolib_textctrlce.o: $(srcdir)/src/msw/wince/textctrlce.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/wince/textctrlce.cpp
monolib_carbon_anybutton.o: $(srcdir)/src/osx/carbon/anybutton.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/carbon/anybutton.cpp
monolib_carbon_bmpbuttn.o: $(srcdir)/src/osx/carbon/bmpbuttn.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/carbon/bmpbuttn.cpp
@ -21595,6 +21663,9 @@ monolib_carbon_tooltip.o: $(srcdir)/src/osx/carbon/tooltip.cpp $(MONOLIB_ODEP)
monolib_carbon_window.o: $(srcdir)/src/osx/carbon/window.cpp $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/carbon/window.cpp
monolib_cocoa_anybutton.o: $(srcdir)/src/osx/cocoa/anybutton.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/anybutton.mm
monolib_osx_cocoa_button.o: $(srcdir)/src/osx/cocoa/button.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/button.mm
@ -21688,6 +21759,9 @@ monolib_osx_cocoa_tooltip.o: $(srcdir)/src/osx/cocoa/tooltip.mm $(MONOLIB_ODEP)
monolib_osx_cocoa_window.o: $(srcdir)/src/osx/cocoa/window.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/window.mm
monolib_iphone_anybutton.o: $(srcdir)/src/osx/iphone/anybutton.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/anybutton.mm
monolib_iphone_button.o: $(srcdir)/src/osx/iphone/button.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/button.mm
@ -24274,6 +24348,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_msw_accel.o: $(srcdir)/src/msw/accel.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/accel.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monolib_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monolib_artmsw.o: $(srcdir)/src/msw/artmsw.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/artmsw.cpp
@ -24562,6 +24642,15 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monolib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monolib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monolib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monolib_bmpbuttn_osx.o: $(srcdir)/src/osx/bmpbuttn_osx.cpp $(MONOLIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/bmpbuttn_osx.cpp
@ -27082,6 +27171,9 @@ coredll_uma.o: $(srcdir)/src/osx/carbon/uma.cpp $(COREDLL_ODEP)
coredll_osx_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/utils.mm
coredll_gtk_anybutton.o: $(srcdir)/src/gtk/anybutton.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/anybutton.cpp
coredll_artgtk.o: $(srcdir)/src/gtk/artgtk.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/artgtk.cpp
@ -27514,6 +27606,9 @@ coredll_tbarwce.o: $(srcdir)/src/msw/wince/tbarwce.cpp $(COREDLL_ODEP)
coredll_textctrlce.o: $(srcdir)/src/msw/wince/textctrlce.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/wince/textctrlce.cpp
coredll_carbon_anybutton.o: $(srcdir)/src/osx/carbon/anybutton.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/anybutton.cpp
coredll_carbon_bmpbuttn.o: $(srcdir)/src/osx/carbon/bmpbuttn.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/bmpbuttn.cpp
@ -27613,6 +27708,9 @@ coredll_carbon_tooltip.o: $(srcdir)/src/osx/carbon/tooltip.cpp $(COREDLL_ODEP)
coredll_carbon_window.o: $(srcdir)/src/osx/carbon/window.cpp $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/window.cpp
coredll_cocoa_anybutton.o: $(srcdir)/src/osx/cocoa/anybutton.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/anybutton.mm
coredll_osx_cocoa_button.o: $(srcdir)/src/osx/cocoa/button.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/button.mm
@ -27706,6 +27804,9 @@ coredll_osx_cocoa_tooltip.o: $(srcdir)/src/osx/cocoa/tooltip.mm $(COREDLL_ODEP)
coredll_osx_cocoa_window.o: $(srcdir)/src/osx/cocoa/window.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/window.mm
coredll_iphone_anybutton.o: $(srcdir)/src/osx/iphone/anybutton.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/anybutton.mm
coredll_iphone_button.o: $(srcdir)/src/osx/iphone/button.mm $(COREDLL_ODEP)
$(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/button.mm
@ -29752,6 +29853,12 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@coredll_msw_accel.o: $(srcdir)/src/msw/accel.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/accel.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@coredll_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@coredll_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@coredll_artmsw.o: $(srcdir)/src/msw/artmsw.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/artmsw.cpp
@ -30040,6 +30147,15 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@coredll_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@coredll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@coredll_bmpbuttn_osx.o: $(srcdir)/src/osx/bmpbuttn_osx.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/bmpbuttn_osx.cpp
@ -31063,6 +31179,9 @@ corelib_uma.o: $(srcdir)/src/osx/carbon/uma.cpp $(CORELIB_ODEP)
corelib_osx_cocoa_utils.o: $(srcdir)/src/osx/cocoa/utils.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/utils.mm
corelib_gtk_anybutton.o: $(srcdir)/src/gtk/anybutton.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/anybutton.cpp
corelib_artgtk.o: $(srcdir)/src/gtk/artgtk.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/artgtk.cpp
@ -31495,6 +31614,9 @@ corelib_tbarwce.o: $(srcdir)/src/msw/wince/tbarwce.cpp $(CORELIB_ODEP)
corelib_textctrlce.o: $(srcdir)/src/msw/wince/textctrlce.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/wince/textctrlce.cpp
corelib_carbon_anybutton.o: $(srcdir)/src/osx/carbon/anybutton.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/anybutton.cpp
corelib_carbon_bmpbuttn.o: $(srcdir)/src/osx/carbon/bmpbuttn.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/bmpbuttn.cpp
@ -31594,6 +31716,9 @@ corelib_carbon_tooltip.o: $(srcdir)/src/osx/carbon/tooltip.cpp $(CORELIB_ODEP)
corelib_carbon_window.o: $(srcdir)/src/osx/carbon/window.cpp $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/window.cpp
corelib_cocoa_anybutton.o: $(srcdir)/src/osx/cocoa/anybutton.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/anybutton.mm
corelib_osx_cocoa_button.o: $(srcdir)/src/osx/cocoa/button.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/button.mm
@ -31687,6 +31812,9 @@ corelib_osx_cocoa_tooltip.o: $(srcdir)/src/osx/cocoa/tooltip.mm $(CORELIB_ODEP)
corelib_osx_cocoa_window.o: $(srcdir)/src/osx/cocoa/window.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/window.mm
corelib_iphone_anybutton.o: $(srcdir)/src/osx/iphone/anybutton.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/anybutton.mm
corelib_iphone_button.o: $(srcdir)/src/osx/iphone/button.mm $(CORELIB_ODEP)
$(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/button.mm
@ -33733,6 +33861,12 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@corelib_msw_accel.o: $(srcdir)/src/msw/accel.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/accel.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@corelib_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@corelib_msw_anybutton.o: $(srcdir)/src/msw/anybutton.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/anybutton.cpp
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@corelib_artmsw.o: $(srcdir)/src/msw/artmsw.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/artmsw.cpp
@ -34021,6 +34155,15 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@corelib_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@corelib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@corelib_bmpbuttn_osx.o: $(srcdir)/src/osx/bmpbuttn_osx.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/bmpbuttn_osx.cpp

View File

@ -812,6 +812,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
<set var="GUI_CMN_HDR" hints="files">
wx/affinematrix2dbase.h
wx/affinematrix2d.h
wx/anybutton.h
wx/bmpbuttn.h
wx/brush.h
wx/button.h
@ -1146,6 +1147,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
<!-- Generic implementations used by wxGPE: -->
src/generic/fontdlgg.cpp
<!-- GTK+ specific files: -->
src/gtk/anybutton.cpp
src/gtk/artgtk.cpp
src/gtk/bmpbuttn.cpp
src/gtk/button.cpp
@ -1200,6 +1202,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/generic/listctrl.h
wx/generic/statusbr.h
wx/gtk/accel.h
wx/gtk/anybutton.h
wx/gtk/bmpbuttn.h
wx/gtk/button.h
wx/gtk/checkbox.h
@ -1727,6 +1730,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
src/generic/statusbr.cpp
src/generic/prntdlgg.cpp
src/msw/accel.cpp
src/msw/anybutton.cpp
src/msw/artmsw.cpp
src/msw/bmpbuttn.cpp
src/msw/button.cpp
@ -1782,6 +1786,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/generic/filepickerg.h
wx/generic/fontpickerg.h
wx/msw/accel.h
wx/msw/anybutton.h
wx/msw/app.h
wx/msw/bitmap.h
wx/msw/bmpbuttn.h
@ -2299,6 +2304,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
<set var="OSX_CARBON_COCOA_SRC" hints="files">
<if cond="PLATFORM_MACOSX=='1'">
<!-- Common controls implementation -->
src/osx/anybutton_osx.cpp
src/osx/bmpbuttn_osx.cpp
src/osx/button_osx.cpp
src/osx/checkbox_osx.cpp
@ -2382,6 +2388,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/html/webkit.h
<!-- other shared headers -->
wx/osx/accel.h
wx/osx/anybutton.h
wx/osx/app.h
wx/osx/bitmap.h
wx/osx/bmpbuttn.h
@ -2483,6 +2490,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
<set var="OSX_CARBON_SRC" hints="files">
<!-- carbon files -->
$(OSX_CARBON_COCOA_SRC)
src/osx/carbon/anybutton.cpp
src/osx/carbon/bmpbuttn.cpp
src/osx/carbon/button.cpp
src/osx/carbon/checkbox.cpp
@ -2540,6 +2548,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
<set var="OSX_COCOA_SRC" hints="files">
$(OSX_CARBON_COCOA_SRC)
src/osx/cocoa/anybutton.mm
src/osx/cocoa/button.mm
src/osx/cocoa/checkbox.mm
src/osx/cocoa/choice.mm
@ -2589,6 +2598,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
src/generic/regiong.cpp
src/generic/icon.cpp
<!-- iphone files -->
src/osx/iphone/anybutton.mm
src/osx/iphone/button.mm
src/osx/iphone/checkbox.mm
src/osx/iphone/dialog.mm

View File

@ -1737,6 +1737,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
$(OBJS)\monodll_generic_statusbr.obj \
$(OBJS)\monodll_prntdlgg.obj \
$(OBJS)\monodll_msw_accel.obj \
$(OBJS)\monodll_anybutton.obj \
$(OBJS)\monodll_artmsw.obj \
$(OBJS)\monodll_msw_bmpbuttn.obj \
$(OBJS)\monodll_msw_button.obj \
@ -2500,6 +2501,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
$(OBJS)\monolib_generic_statusbr.obj \
$(OBJS)\monolib_prntdlgg.obj \
$(OBJS)\monolib_msw_accel.obj \
$(OBJS)\monolib_anybutton.obj \
$(OBJS)\monolib_artmsw.obj \
$(OBJS)\monolib_msw_bmpbuttn.obj \
$(OBJS)\monolib_msw_button.obj \
@ -3151,6 +3153,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
$(OBJS)\coredll_generic_statusbr.obj \
$(OBJS)\coredll_prntdlgg.obj \
$(OBJS)\coredll_msw_accel.obj \
$(OBJS)\coredll_anybutton.obj \
$(OBJS)\coredll_artmsw.obj \
$(OBJS)\coredll_msw_bmpbuttn.obj \
$(OBJS)\coredll_msw_button.obj \
@ -3692,6 +3695,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
$(OBJS)\corelib_generic_statusbr.obj \
$(OBJS)\corelib_prntdlgg.obj \
$(OBJS)\corelib_msw_accel.obj \
$(OBJS)\corelib_anybutton.obj \
$(OBJS)\corelib_artmsw.obj \
$(OBJS)\corelib_msw_bmpbuttn.obj \
$(OBJS)\corelib_msw_button.obj \
@ -6277,6 +6281,9 @@ $(OBJS)\monodll_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\monodll_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\monodll_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\monodll_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\artmsw.cpp
@ -8625,6 +8632,9 @@ $(OBJS)\monolib_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\monolib_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\monolib_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\monolib_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\artmsw.cpp
@ -11384,6 +11394,9 @@ $(OBJS)\coredll_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\coredll_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\coredll_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\coredll_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\artmsw.cpp
@ -12789,6 +12802,9 @@ $(OBJS)\corelib_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\corelib_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\corelib_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\corelib_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\artmsw.cpp

View File

@ -1748,6 +1748,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
$(OBJS)\monodll_generic_statusbr.o \
$(OBJS)\monodll_prntdlgg.o \
$(OBJS)\monodll_msw_accel.o \
$(OBJS)\monodll_anybutton.o \
$(OBJS)\monodll_artmsw.o \
$(OBJS)\monodll_msw_bmpbuttn.o \
$(OBJS)\monodll_msw_button.o \
@ -2517,6 +2518,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
$(OBJS)\monolib_generic_statusbr.o \
$(OBJS)\monolib_prntdlgg.o \
$(OBJS)\monolib_msw_accel.o \
$(OBJS)\monolib_anybutton.o \
$(OBJS)\monolib_artmsw.o \
$(OBJS)\monolib_msw_bmpbuttn.o \
$(OBJS)\monolib_msw_button.o \
@ -3184,6 +3186,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
$(OBJS)\coredll_generic_statusbr.o \
$(OBJS)\coredll_prntdlgg.o \
$(OBJS)\coredll_msw_accel.o \
$(OBJS)\coredll_anybutton.o \
$(OBJS)\coredll_artmsw.o \
$(OBJS)\coredll_msw_bmpbuttn.o \
$(OBJS)\coredll_msw_button.o \
@ -3733,6 +3736,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
$(OBJS)\corelib_generic_statusbr.o \
$(OBJS)\corelib_prntdlgg.o \
$(OBJS)\corelib_msw_accel.o \
$(OBJS)\corelib_anybutton.o \
$(OBJS)\corelib_artmsw.o \
$(OBJS)\corelib_msw_bmpbuttn.o \
$(OBJS)\corelib_msw_button.o \
@ -6427,6 +6431,9 @@ $(OBJS)\monodll_generic_statusbr.o: ../../src/generic/statusbr.cpp
$(OBJS)\monodll_msw_accel.o: ../../src/msw/accel.cpp
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\monodll_anybutton.o: ../../src/msw/anybutton.cpp
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\monodll_artmsw.o: ../../src/msw/artmsw.cpp
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
@ -8775,6 +8782,9 @@ $(OBJS)\monolib_generic_statusbr.o: ../../src/generic/statusbr.cpp
$(OBJS)\monolib_msw_accel.o: ../../src/msw/accel.cpp
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\monolib_anybutton.o: ../../src/msw/anybutton.cpp
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\monolib_artmsw.o: ../../src/msw/artmsw.cpp
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
@ -11534,6 +11544,9 @@ $(OBJS)\coredll_generic_statusbr.o: ../../src/generic/statusbr.cpp
$(OBJS)\coredll_msw_accel.o: ../../src/msw/accel.cpp
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\coredll_anybutton.o: ../../src/msw/anybutton.cpp
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\coredll_artmsw.o: ../../src/msw/artmsw.cpp
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
@ -12939,6 +12952,9 @@ $(OBJS)\corelib_generic_statusbr.o: ../../src/generic/statusbr.cpp
$(OBJS)\corelib_msw_accel.o: ../../src/msw/accel.cpp
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\corelib_anybutton.o: ../../src/msw/anybutton.cpp
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\corelib_artmsw.o: ../../src/msw/artmsw.cpp
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<

View File

@ -1945,6 +1945,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
$(OBJS)\monodll_generic_statusbr.obj \
$(OBJS)\monodll_prntdlgg.obj \
$(OBJS)\monodll_msw_accel.obj \
$(OBJS)\monodll_anybutton.obj \
$(OBJS)\monodll_artmsw.obj \
$(OBJS)\monodll_msw_bmpbuttn.obj \
$(OBJS)\monodll_msw_button.obj \
@ -2714,6 +2715,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
$(OBJS)\monolib_generic_statusbr.obj \
$(OBJS)\monolib_prntdlgg.obj \
$(OBJS)\monolib_msw_accel.obj \
$(OBJS)\monolib_anybutton.obj \
$(OBJS)\monolib_artmsw.obj \
$(OBJS)\monolib_msw_bmpbuttn.obj \
$(OBJS)\monolib_msw_button.obj \
@ -3431,6 +3433,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
$(OBJS)\coredll_generic_statusbr.obj \
$(OBJS)\coredll_prntdlgg.obj \
$(OBJS)\coredll_msw_accel.obj \
$(OBJS)\coredll_anybutton.obj \
$(OBJS)\coredll_artmsw.obj \
$(OBJS)\coredll_msw_bmpbuttn.obj \
$(OBJS)\coredll_msw_button.obj \
@ -3978,6 +3981,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
$(OBJS)\corelib_generic_statusbr.obj \
$(OBJS)\corelib_prntdlgg.obj \
$(OBJS)\corelib_msw_accel.obj \
$(OBJS)\corelib_anybutton.obj \
$(OBJS)\corelib_artmsw.obj \
$(OBJS)\corelib_msw_bmpbuttn.obj \
$(OBJS)\corelib_msw_button.obj \
@ -6857,6 +6861,9 @@ $(OBJS)\monodll_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\monodll_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\monodll_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\monodll_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\artmsw.cpp
@ -9205,6 +9212,9 @@ $(OBJS)\monolib_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\monolib_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\monolib_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\monolib_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\artmsw.cpp
@ -11964,6 +11974,9 @@ $(OBJS)\coredll_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\coredll_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\coredll_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\coredll_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\artmsw.cpp
@ -13369,6 +13382,9 @@ $(OBJS)\corelib_generic_statusbr.obj: ..\..\src\generic\statusbr.cpp
$(OBJS)\corelib_msw_accel.obj: ..\..\src\msw\accel.cpp
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\accel.cpp
$(OBJS)\corelib_anybutton.obj: ..\..\src\msw\anybutton.cpp
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\anybutton.cpp
$(OBJS)\corelib_artmsw.obj: ..\..\src\msw\artmsw.cpp
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\artmsw.cpp

View File

@ -299,6 +299,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = &
$(OBJS)\monodll_generic_statusbr.obj &
$(OBJS)\monodll_prntdlgg.obj &
$(OBJS)\monodll_msw_accel.obj &
$(OBJS)\monodll_anybutton.obj &
$(OBJS)\monodll_artmsw.obj &
$(OBJS)\monodll_msw_bmpbuttn.obj &
$(OBJS)\monodll_msw_button.obj &
@ -1073,6 +1074,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = &
$(OBJS)\monolib_generic_statusbr.obj &
$(OBJS)\monolib_prntdlgg.obj &
$(OBJS)\monolib_msw_accel.obj &
$(OBJS)\monolib_anybutton.obj &
$(OBJS)\monolib_artmsw.obj &
$(OBJS)\monolib_msw_bmpbuttn.obj &
$(OBJS)\monolib_msw_button.obj &
@ -1751,6 +1753,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = &
$(OBJS)\coredll_generic_statusbr.obj &
$(OBJS)\coredll_prntdlgg.obj &
$(OBJS)\coredll_msw_accel.obj &
$(OBJS)\coredll_anybutton.obj &
$(OBJS)\coredll_artmsw.obj &
$(OBJS)\coredll_msw_bmpbuttn.obj &
$(OBJS)\coredll_msw_button.obj &
@ -2302,6 +2305,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = &
$(OBJS)\corelib_generic_statusbr.obj &
$(OBJS)\corelib_prntdlgg.obj &
$(OBJS)\corelib_msw_accel.obj &
$(OBJS)\corelib_anybutton.obj &
$(OBJS)\corelib_artmsw.obj &
$(OBJS)\corelib_msw_bmpbuttn.obj &
$(OBJS)\corelib_msw_button.obj &
@ -6686,6 +6690,9 @@ $(OBJS)\monodll_generic_statusbr.obj : .AUTODEPEND ..\..\src\generic\statusbr.c
$(OBJS)\monodll_msw_accel.obj : .AUTODEPEND ..\..\src\msw\accel.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
$(OBJS)\monodll_anybutton.obj : .AUTODEPEND ..\..\src\msw\anybutton.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
$(OBJS)\monodll_artmsw.obj : .AUTODEPEND ..\..\src\msw\artmsw.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
@ -9034,6 +9041,9 @@ $(OBJS)\monolib_generic_statusbr.obj : .AUTODEPEND ..\..\src\generic\statusbr.c
$(OBJS)\monolib_msw_accel.obj : .AUTODEPEND ..\..\src\msw\accel.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
$(OBJS)\monolib_anybutton.obj : .AUTODEPEND ..\..\src\msw\anybutton.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
$(OBJS)\monolib_artmsw.obj : .AUTODEPEND ..\..\src\msw\artmsw.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
@ -11793,6 +11803,9 @@ $(OBJS)\coredll_generic_statusbr.obj : .AUTODEPEND ..\..\src\generic\statusbr.c
$(OBJS)\coredll_msw_accel.obj : .AUTODEPEND ..\..\src\msw\accel.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
$(OBJS)\coredll_anybutton.obj : .AUTODEPEND ..\..\src\msw\anybutton.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
$(OBJS)\coredll_artmsw.obj : .AUTODEPEND ..\..\src\msw\artmsw.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
@ -13198,6 +13211,9 @@ $(OBJS)\corelib_generic_statusbr.obj : .AUTODEPEND ..\..\src\generic\statusbr.c
$(OBJS)\corelib_msw_accel.obj : .AUTODEPEND ..\..\src\msw\accel.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
$(OBJS)\corelib_anybutton.obj : .AUTODEPEND ..\..\src\msw\anybutton.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
$(OBJS)\corelib_artmsw.obj : .AUTODEPEND ..\..\src\msw\artmsw.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<

View File

@ -840,6 +840,41 @@ SOURCE=..\..\src\msw\ole\activex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\msw\anybutton.cpp
!IF "$(CFG)" == "core - Win32 DLL Universal Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "core - Win32 DLL Universal Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "core - Win32 DLL Release"
!ELSEIF "$(CFG)" == "core - Win32 DLL Debug"
!ELSEIF "$(CFG)" == "core - Win32 Universal Release"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "core - Win32 Universal Debug"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "core - Win32 Release"
!ELSEIF "$(CFG)" == "core - Win32 Debug"
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\src\msw\app.cpp
# End Source File
# Begin Source File
@ -4886,6 +4921,10 @@ SOURCE=..\..\include\wx\msw\ole\activex.h
# End Source File
# Begin Source File
SOURCE=..\..\include\wx\msw\anybutton.h
# End Source File
# Begin Source File
SOURCE=..\..\include\wx\msw\app.h
# End Source File
# Begin Source File
@ -5917,6 +5956,10 @@ SOURCE=..\..\include\wx\animdecod.h
# End Source File
# Begin Source File
SOURCE=..\..\include\wx\anybutton.h
# End Source File
# Begin Source File
SOURCE=..\..\include\wx\ribbon\art.h
# End Source File
# Begin Source File

View File

@ -1024,6 +1024,21 @@
<File
RelativePath="..\..\src\msw\ole\activex.cpp">
</File>
<File
RelativePath="..\..\src\msw\anybutton.cpp">
<FileConfiguration
Name="Universal Debug|Win32"
ExcludedFromBuild="TRUE"/>
<FileConfiguration
Name="Universal Release|Win32"
ExcludedFromBuild="TRUE"/>
<FileConfiguration
Name="DLL Universal Debug|Win32"
ExcludedFromBuild="TRUE"/>
<FileConfiguration
Name="DLL Universal Release|Win32"
ExcludedFromBuild="TRUE"/>
</File>
<File
RelativePath="..\..\src\msw\app.cpp">
</File>
@ -4237,6 +4252,9 @@
<File
RelativePath="..\..\include\wx\msw\ole\activex.h">
</File>
<File
RelativePath="..\..\include\wx\msw\anybutton.h">
</File>
<File
RelativePath="..\..\include\wx\msw\app.h">
</File>
@ -5024,6 +5042,9 @@
<File
RelativePath="..\..\include\wx\animdecod.h">
</File>
<File
RelativePath="..\..\include\wx\anybutton.h">
</File>
<File
RelativePath="..\..\include\wx\ribbon\art.h">
</File>

View File

@ -1399,6 +1399,26 @@
RelativePath="..\..\src\msw\ole\activex.cpp"
>
</File>
<File
RelativePath="..\..\src\msw\anybutton.cpp"
>
<FileConfiguration
Name="Universal Debug|Win32"
ExcludedFromBuild="true"
/>
<FileConfiguration
Name="Universal Release|Win32"
ExcludedFromBuild="true"
/>
<FileConfiguration
Name="DLL Universal Debug|Win32"
ExcludedFromBuild="true"
/>
<FileConfiguration
Name="DLL Universal Release|Win32"
ExcludedFromBuild="true"
/>
</File>
<File
RelativePath="..\..\src\msw\app.cpp"
>
@ -5679,6 +5699,10 @@
RelativePath="..\..\include\wx\msw\ole\activex.h"
>
</File>
<File
RelativePath="..\..\include\wx\msw\anybutton.h"
>
</File>
<File
RelativePath="..\..\include\wx\msw\app.h"
>
@ -6719,6 +6743,10 @@
RelativePath="..\..\include\wx\animdecod.h"
>
</File>
<File
RelativePath="..\..\include\wx\anybutton.h"
>
</File>
<File
RelativePath="..\..\include\wx\ribbon\art.h"
>

View File

@ -1395,6 +1395,26 @@
RelativePath="..\..\src\msw\ole\activex.cpp"
>
</File>
<File
RelativePath="..\..\src\msw\anybutton.cpp"
>
<FileConfiguration
Name="Universal Debug|Win32"
ExcludedFromBuild="true"
/>
<FileConfiguration
Name="Universal Release|Win32"
ExcludedFromBuild="true"
/>
<FileConfiguration
Name="DLL Universal Debug|Win32"
ExcludedFromBuild="true"
/>
<FileConfiguration
Name="DLL Universal Release|Win32"
ExcludedFromBuild="true"
/>
</File>
<File
RelativePath="..\..\src\msw\app.cpp"
>
@ -5675,6 +5695,10 @@
RelativePath="..\..\include\wx\msw\ole\activex.h"
>
</File>
<File
RelativePath="..\..\include\wx\msw\anybutton.h"
>
</File>
<File
RelativePath="..\..\include\wx\msw\app.h"
>
@ -6715,6 +6739,10 @@
RelativePath="..\..\include\wx\animdecod.h"
>
</File>
<File
RelativePath="..\..\include\wx\anybutton.h"
>
</File>
<File
RelativePath="..\..\include\wx\ribbon\art.h"
>

View File

@ -467,6 +467,7 @@ All (GUI):
- Added wxCommandLinkButton (Rickard Westerlund, GSoC 2010 project).
- Added wxUIActionSimulator (Steven Lamerton, GSoC 2010 project).
- Added support for dynamic auto-completion in wxTextEntry.
- Added images support to wxToggleButton (Garrick Meeker).
- wxAUI: support auto-orientable toolbars (wsu).
- wxAUI: add support for icons in pane title bars (triton).
- Added wxPanel::SetBackgroundBitmap().

202
include/wx/anybutton.h Normal file
View File

@ -0,0 +1,202 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/anybutton.h
// Purpose: wxAnyButtonBase class
// Author: Vadim Zetlin
// Created: 2000-08-15 (extracted from button.h)
// RCS-ID: $Id: anybutton.h 65680 2010-09-30 11:44:45Z VZ $
// Copyright: (c) Vadim Zetlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ANYBUTTON_H_BASE_
#define _WX_ANYBUTTON_H_BASE_
#include "wx/defs.h"
#ifdef wxHAS_ANY_BUTTON
// ----------------------------------------------------------------------------
// wxAnyButton specific flags
// ----------------------------------------------------------------------------
// These flags affect label alignment
#define wxBU_LEFT 0x0040
#define wxBU_TOP 0x0080
#define wxBU_RIGHT 0x0100
#define wxBU_BOTTOM 0x0200
#define wxBU_ALIGN_MASK ( wxBU_LEFT | wxBU_TOP | wxBU_RIGHT | wxBU_BOTTOM )
// These two flags are obsolete
#define wxBU_NOAUTODRAW 0x0000
#define wxBU_AUTODRAW 0x0004
// by default, the buttons will be created with some (system dependent)
// minimal size to make them look nicer, giving this style will make them as
// small as possible
#define wxBU_EXACTFIT 0x0001
// this flag can be used to disable using the text label in the button: it is
// mostly useful when creating buttons showing bitmap and having stock id as
// without it both the standard label corresponding to the stock id and the
// bitmap would be shown
#define wxBU_NOTEXT 0x0002
#include "wx/bitmap.h"
#include "wx/control.h"
// ----------------------------------------------------------------------------
// wxAnyButton: common button functionality
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyButtonBase : public wxControl
{
public:
wxAnyButtonBase() { }
// show the image in the button in addition to the label: this method is
// supported on all (major) platforms
void SetBitmap(const wxBitmap& bitmap, wxDirection dir = wxLEFT)
{
SetBitmapLabel(bitmap);
SetBitmapPosition(dir);
}
wxBitmap GetBitmap() const { return DoGetBitmap(State_Normal); }
// Methods for setting individual images for different states: normal,
// selected (meaning pushed or pressed), focused (meaning normal state for
// a focused button), disabled or hover (a.k.a. hot or current).
//
// Remember that SetBitmap() itself must be called before any other
// SetBitmapXXX() methods (except for SetBitmapLabel() which is a synonym
// for it anyhow) and that all bitmaps passed to these functions should be
// of the same size.
void SetBitmapLabel(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Normal); }
void SetBitmapPressed(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Pressed); }
void SetBitmapDisabled(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Disabled); }
void SetBitmapCurrent(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Current); }
void SetBitmapFocus(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Focused); }
wxBitmap GetBitmapLabel() const { return DoGetBitmap(State_Normal); }
wxBitmap GetBitmapPressed() const { return DoGetBitmap(State_Pressed); }
wxBitmap GetBitmapDisabled() const { return DoGetBitmap(State_Disabled); }
wxBitmap GetBitmapCurrent() const { return DoGetBitmap(State_Current); }
wxBitmap GetBitmapFocus() const { return DoGetBitmap(State_Focused); }
// set the margins around the image
void SetBitmapMargins(wxCoord x, wxCoord y) { DoSetBitmapMargins(x, y); }
void SetBitmapMargins(const wxSize& sz) { DoSetBitmapMargins(sz.x, sz.y); }
wxSize GetBitmapMargins() { return DoGetBitmapMargins(); }
// set the image position relative to the text, i.e. wxLEFT means that the
// image is to the left of the text (this is the default)
void SetBitmapPosition(wxDirection dir);
// Buttons on MSW can look bad if they are not native colours, because
// then they become owner-drawn and not theme-drawn. Disable it here
// in wxAnyButtonBase to make it consistent.
virtual bool ShouldInheritColours() const { return false; }
// wxUniv-compatible and deprecated equivalents to SetBitmapXXX()
#if WXWIN_COMPATIBILITY_2_8
void SetImageLabel(const wxBitmap& bitmap) { SetBitmap(bitmap); }
void SetImageMargins(wxCoord x, wxCoord y) { SetBitmapMargins(x, y); }
#endif // WXWIN_COMPATIBILITY_2_8
// backwards compatible names for pressed/current bitmaps: they're not
// deprecated as there is nothing really wrong with using them and no real
// advantage to using the new names but the new names are still preferred
wxBitmap GetBitmapSelected() const { return GetBitmapPressed(); }
wxBitmap GetBitmapHover() const { return GetBitmapCurrent(); }
void SetBitmapSelected(const wxBitmap& bitmap) { SetBitmapPressed(bitmap); }
void SetBitmapHover(const wxBitmap& bitmap) { SetBitmapCurrent(bitmap); }
// this enum is not part of wx public API, it is public because it is used
// in non wxAnyButton-derived classes internally
//
// also notice that MSW code relies on the values of the enum elements, do
// not change them without revising src/msw/button.cpp
enum State
{
State_Normal,
State_Current, // a.k.a. hot or "hovering"
State_Pressed, // a.k.a. "selected" in public API for some reason
State_Disabled,
State_Focused,
State_Max
};
// return true if this button shouldn't show the text label, either because
// it doesn't have it or because it was explicitly disabled with wxBU_NOTEXT
bool DontShowLabel() const
{
return HasFlag(wxBU_NOTEXT) || GetLabel().empty();
}
// return true if we do show the label
bool ShowsLabel() const
{
return !DontShowLabel();
}
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxBitmap DoGetBitmap(State WXUNUSED(which)) const
{ return wxBitmap(); }
virtual void DoSetBitmap(const wxBitmap& WXUNUSED(bitmap),
State WXUNUSED(which))
{ }
virtual wxSize DoGetBitmapMargins() const
{ return wxSize(0, 0); }
virtual void DoSetBitmapMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
{ }
virtual void DoSetBitmapPosition(wxDirection WXUNUSED(dir))
{ }
virtual bool DoGetAuthNeeded() const { return false; }
virtual void DoSetAuthNeeded(bool WXUNUSED(show)) { }
wxDECLARE_NO_COPY_CLASS(wxAnyButtonBase);
};
//#if defined(__WXUNIVERSAL__)
// #include "wx/univ/anybutton.h"
#if defined(__WXMSW__)
#include "wx/msw/anybutton.h"
//#elif defined(__WXMOTIF__)
// #include "wx/motif/anybutton.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/anybutton.h"
//#elif defined(__WXGTK__)
// #include "wx/gtk1/anybutton.h"
#elif defined(__WXMAC__)
#include "wx/osx/anybutton.h"
//#elif defined(__WXCOCOA__)
// #include "wx/cocoa/anybutton.h"
//#elif defined(__WXPM__)
// #include "wx/os2/anybutton.h"
//#elif defined(__WXPALMOS__)
// #include "wx/palmos/anybutton.h"
#else
typedef wxAnyButtonBase wxAnyButton;
#endif
#endif // wxHAS_ANY_BUTTON
#endif // _WX_ANYBUTTON_H_BASE_

View File

@ -14,44 +14,9 @@
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// wxButton flags shared with other classes
// ----------------------------------------------------------------------------
#if wxUSE_TOGGLEBTN || wxUSE_BUTTON
// These flags affect label alignment
#define wxBU_LEFT 0x0040
#define wxBU_TOP 0x0080
#define wxBU_RIGHT 0x0100
#define wxBU_BOTTOM 0x0200
#define wxBU_ALIGN_MASK ( wxBU_LEFT | wxBU_TOP | wxBU_RIGHT | wxBU_BOTTOM )
#endif
#if wxUSE_BUTTON
// ----------------------------------------------------------------------------
// wxButton specific flags
// ----------------------------------------------------------------------------
// These two flags are obsolete
#define wxBU_NOAUTODRAW 0x0000
#define wxBU_AUTODRAW 0x0004
// by default, the buttons will be created with some (system dependent)
// minimal size to make them look nicer, giving this style will make them as
// small as possible
#define wxBU_EXACTFIT 0x0001
// this flag can be used to disable using the text label in the button: it is
// mostly useful when creating buttons showing bitmap and having stock id as
// without it both the standard label corresponding to the stock id and the
// bitmap would be shown
#define wxBU_NOTEXT 0x0002
#include "wx/bitmap.h"
#include "wx/control.h"
#include "wx/anybutton.h"
extern WXDLLIMPEXP_DATA_CORE(const char) wxButtonNameStr[];
@ -59,7 +24,7 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxButtonNameStr[];
// wxButton: a push button
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxButtonBase : public wxControl
class WXDLLIMPEXP_CORE wxButtonBase : public wxAnyButton
{
public:
wxButtonBase() { }
@ -70,132 +35,15 @@ public:
void SetAuthNeeded(bool show = true) { DoSetAuthNeeded(show); }
bool GetAuthNeeded() const { return DoGetAuthNeeded(); }
// show the image in the button in addition to the label: this method is
// supported on all (major) platforms
void SetBitmap(const wxBitmap& bitmap, wxDirection dir = wxLEFT)
{
SetBitmapLabel(bitmap);
SetBitmapPosition(dir);
}
wxBitmap GetBitmap() const { return DoGetBitmap(State_Normal); }
// Methods for setting individual images for different states: normal,
// selected (meaning pushed or pressed), focused (meaning normal state for
// a focused button), disabled or hover (a.k.a. hot or current).
//
// Remember that SetBitmap() itself must be called before any other
// SetBitmapXXX() methods (except for SetBitmapLabel() which is a synonym
// for it anyhow) and that all bitmaps passed to these functions should be
// of the same size.
void SetBitmapLabel(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Normal); }
void SetBitmapPressed(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Pressed); }
void SetBitmapDisabled(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Disabled); }
void SetBitmapCurrent(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Current); }
void SetBitmapFocus(const wxBitmap& bitmap)
{ DoSetBitmap(bitmap, State_Focused); }
wxBitmap GetBitmapLabel() const { return DoGetBitmap(State_Normal); }
wxBitmap GetBitmapPressed() const { return DoGetBitmap(State_Pressed); }
wxBitmap GetBitmapDisabled() const { return DoGetBitmap(State_Disabled); }
wxBitmap GetBitmapCurrent() const { return DoGetBitmap(State_Current); }
wxBitmap GetBitmapFocus() const { return DoGetBitmap(State_Focused); }
// set the margins around the image
void SetBitmapMargins(wxCoord x, wxCoord y) { DoSetBitmapMargins(x, y); }
void SetBitmapMargins(const wxSize& sz) { DoSetBitmapMargins(sz.x, sz.y); }
wxSize GetBitmapMargins() { return DoGetBitmapMargins(); }
// set the image position relative to the text, i.e. wxLEFT means that the
// image is to the left of the text (this is the default)
void SetBitmapPosition(wxDirection dir);
// make this button the default button in its top level window
//
// returns the old default item (possibly NULL)
virtual wxWindow *SetDefault();
// Buttons on MSW can look bad if they are not native colours, because
// then they become owner-drawn and not theme-drawn. Disable it here
// in wxButtonBase to make it consistent.
virtual bool ShouldInheritColours() const { return false; }
// returns the default button size for this platform
static wxSize GetDefaultSize();
// wxUniv-compatible and deprecated equivalents to SetBitmapXXX()
#if WXWIN_COMPATIBILITY_2_8
void SetImageLabel(const wxBitmap& bitmap) { SetBitmap(bitmap); }
void SetImageMargins(wxCoord x, wxCoord y) { SetBitmapMargins(x, y); }
#endif // WXWIN_COMPATIBILITY_2_8
// backwards compatible names for pressed/current bitmaps: they're not
// deprecated as there is nothing really wrong with using them and no real
// advantage to using the new names but the new names are still preferred
wxBitmap GetBitmapSelected() const { return GetBitmapPressed(); }
wxBitmap GetBitmapHover() const { return GetBitmapCurrent(); }
void SetBitmapSelected(const wxBitmap& bitmap) { SetBitmapPressed(bitmap); }
void SetBitmapHover(const wxBitmap& bitmap) { SetBitmapCurrent(bitmap); }
// this enum is not part of wx public API, it is public because it is used
// in non wxButton-derived classes internally
//
// also notice that MSW code relies on the values of the enum elements, do
// not change them without revising src/msw/button.cpp
enum State
{
State_Normal,
State_Current, // a.k.a. hot or "hovering"
State_Pressed, // a.k.a. "selected" in public API for some reason
State_Disabled,
State_Focused,
State_Max
};
// return true if this button shouldn't show the text label, either because
// it doesn't have it or because it was explicitly disabled with wxBU_NOTEXT
bool DontShowLabel() const
{
return HasFlag(wxBU_NOTEXT) || GetLabel().empty();
}
// return true if we do show the label
bool ShowsLabel() const
{
return !DontShowLabel();
}
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual bool DoGetAuthNeeded() const { return false; }
virtual void DoSetAuthNeeded(bool WXUNUSED(show)) { }
virtual wxBitmap DoGetBitmap(State WXUNUSED(which)) const
{ return wxBitmap(); }
virtual void DoSetBitmap(const wxBitmap& WXUNUSED(bitmap),
State WXUNUSED(which))
{ }
virtual wxSize DoGetBitmapMargins() const
{ return wxSize(0, 0); }
virtual void DoSetBitmapMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
{ }
virtual void DoSetBitmapPosition(wxDirection WXUNUSED(dir))
{ }
wxDECLARE_NO_COPY_CLASS(wxButtonBase);
};
@ -221,5 +69,4 @@ protected:
#endif // wxUSE_BUTTON
#endif
// _WX_BUTTON_H_BASE_
#endif // _WX_BUTTON_H_BASE_

View File

@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/anybutton.h
// Purpose: wxGTK wxAnyButton class declaration
// Author: Robert Roebling
// Created: 1998-05-20 (extracted from button.h)
// Id: $Id: anybutton.h 67066 2011-02-27 12:48:30Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_ANYBUTTON_H_
#define _WX_GTK_ANYBUTTON_H_
//-----------------------------------------------------------------------------
// wxAnyButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton()
{
m_isCurrent =
m_isPressed = false;
}
virtual bool Enable( bool enable = true );
// implementation
// --------------
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// called from GTK callbacks: they update the button state and call
// GTKUpdateBitmap()
void GTKMouseEnters();
void GTKMouseLeaves();
void GTKPressed();
void GTKReleased();
protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual void DoSetBitmapPosition(wxDirection dir);
private:
typedef wxAnyButtonBase base_type;
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
// update the bitmap to correspond to the current button state
void GTKUpdateBitmap();
// return the current button state from m_isXXX flags (which means that it
// might not correspond to the real current state as e.g. m_isCurrent will
// never be true if we don't have a valid current bitmap)
State GTKGetCurrentState() const;
// show the given bitmap (must be valid)
void GTKDoShowBitmap(const wxBitmap& bitmap);
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
wxBitmap m_bitmaps[State_Max];
// true iff mouse is currently over the button
bool m_isCurrent;
// true iff the button is in pressed state
bool m_isPressed;
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
};
#endif // _WX_GTK_ANYBUTTON_H_

View File

@ -17,7 +17,7 @@
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
{
public:
wxButton() { Init(); }
wxButton() {}
wxButton(wxWindow *parent, wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
@ -25,8 +25,6 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
{
Init();
Create(parent, id, label, pos, size, style, validator, name);
}
@ -39,7 +37,6 @@ public:
virtual wxWindow *SetDefault();
virtual void SetLabel( const wxString &label );
virtual bool Enable( bool enable = true );
// implementation
// --------------
@ -61,12 +58,6 @@ protected:
virtual wxSize DoGetBestSize() const;
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual void DoSetBitmapPosition(wxDirection dir);
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
@ -74,42 +65,9 @@ protected:
private:
typedef wxButtonBase base_type;
// common part of all ctors
void Init()
{
m_isCurrent =
m_isPressed = false;
}
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
// update the bitmap to correspond to the current button state
void GTKUpdateBitmap();
// return the current button state from m_isXXX flags (which means that it
// might not correspond to the real current state as e.g. m_isCurrent will
// never be true if we don't have a valid current bitmap)
State GTKGetCurrentState() const;
// show the given bitmap (must be valid)
void GTKDoShowBitmap(const wxBitmap& bitmap);
// Return the GtkLabel used by this button.
GtkLabel *GTKGetLabel() const;
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
wxBitmap m_bitmaps[State_Max];
// true iff mouse is currently over the button
bool m_isCurrent;
// true iff the button is in pressed state
bool m_isPressed;
DECLARE_DYNAMIC_CLASS(wxButton)
};

View File

@ -22,67 +22,6 @@
class WXDLLIMPEXP_FWD_CORE wxToggleButton;
class WXDLLIMPEXP_FWD_CORE wxToggleBitmapButton;
//-----------------------------------------------------------------------------
// wxBitmapToggleButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButtonBase
{
public:
// construction/destruction
wxBitmapToggleButton() {}
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
// Get/set the value
void SetValue(bool state);
bool GetValue() const;
// Set the label
virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }
virtual void SetLabel(const wxBitmap& label);
bool Enable(bool enable = true);
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// implementation
wxBitmap m_bitmap;
void OnSetBitmap();
protected:
void GTKDisableEvents();
void GTKEnableEvents();
virtual wxSize DoGetBestSize() const;
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
private:
typedef wxToggleButtonBase base_type;
DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
};
//-----------------------------------------------------------------------------
// wxToggleButton
//-----------------------------------------------------------------------------
@ -119,7 +58,6 @@ public:
// Set the label
void SetLabel(const wxString& label);
bool Enable(bool enable = true);
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
@ -130,13 +68,61 @@ protected:
virtual wxSize DoGetBestSize() const;
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
private:
typedef wxToggleButtonBase base_type;
// Return the GtkLabel used by this toggle button.
GtkLabel *GTKGetLabel() const;
DECLARE_DYNAMIC_CLASS(wxToggleButton)
};
//-----------------------------------------------------------------------------
// wxBitmapToggleButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButton
{
public:
// construction/destruction
wxBitmapToggleButton() {}
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
// deprecated synonym for SetBitmapLabel()
wxDEPRECATED_INLINE( void SetLabel(const wxBitmap& bitmap),
SetBitmapLabel(bitmap); )
// prevent virtual function hiding
virtual void SetLabel(const wxString& label) { wxToggleButton::SetLabel(label); }
private:
typedef wxToggleButtonBase base_type;
DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
};
#endif // _WX_GTK_TOGGLEBUTTON_H_

View File

@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/anybutton.h
// Purpose: wxAnyButton class
// Author: Julian Smart
// Created: 1997-02-01 (extracted from button.h)
// RCS-ID: $Id: anybutton.h 67065 2011-02-27 12:48:26Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_ANYBUTTON_H_
#define _WX_MSW_ANYBUTTON_H_
// ----------------------------------------------------------------------------
// Common button functionality
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton()
{
m_imageData = NULL;
#if wxUSE_MARKUP
m_markupText = NULL;
#endif // wxUSE_MARKUP
}
virtual ~wxAnyButton();
// overridden base class methods
virtual void SetLabel(const wxString& label);
virtual bool SetBackgroundColour(const wxColour &colour);
virtual bool SetForegroundColour(const wxColour &colour);
// implementation from now on
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
virtual State GetNormalState() const { return State_Normal; }
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
// usually overridden base class virtuals
virtual wxSize DoGetBestSize() const;
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual wxSize DoGetBitmapMargins() const;
virtual void DoSetBitmapMargins(wxCoord x, wxCoord y);
virtual void DoSetBitmapPosition(wxDirection dir);
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
// Increases the passed in size to account for the button image.
//
// Should only be called if we do have a button, i.e. if m_imageData is
// non-NULL.
void AdjustForBitmapSize(wxSize& size) const;
class wxButtonImageData *m_imageData;
#if wxUSE_MARKUP
class wxMarkupText *m_markupText;
#endif // wxUSE_MARKUP
// Switches button into owner-drawn mode: this is used if we need to draw
// something not supported by the native control, such as using non default
// colours or a bitmap on pre-XP systems.
void MakeOwnerDrawn();
bool IsOwnerDrawn() const;
private:
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
};
#endif // _WX_MSW_ANYBUTTON_H_

View File

@ -19,7 +19,7 @@
class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
{
public:
wxBitmapButton() { Init(); }
wxBitmapButton() {}
wxBitmapButton(wxWindow *parent,
wxWindowID id,
@ -30,8 +30,6 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
{
Init();
Create(parent, id, bitmap, pos, size, style, validator, name);
}
@ -45,25 +43,6 @@ public:
const wxString& name = wxButtonNameStr);
protected:
// common part of all ctors
void Init()
{
m_disabledSetByUser =
m_hoverSetByUser = false;
}
// reimplement some base class virtuals
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
// true if disabled bitmap was set by user, false if we created it
// ourselves from the normal one
bool m_disabledSetByUser;
// true if hover bitmap was set by user, false if it was set from focused
// one
bool m_hoverSetByUser;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton)
};

View File

@ -9,8 +9,8 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUTTON_H_
#define _WX_BUTTON_H_
#ifndef _WX_MSW_BUTTON_H_
#define _WX_MSW_BUTTON_H_
// ----------------------------------------------------------------------------
// Pushbutton
@ -47,22 +47,13 @@ public:
virtual wxWindow *SetDefault();
// overridden base class methods
virtual void SetLabel(const wxString& label);
virtual bool SetBackgroundColour(const wxColour &colour);
virtual bool SetForegroundColour(const wxColour &colour);
// implementation from now on
virtual void Command(wxCommandEvent& event);
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
// send a notification event, return true if processed
bool SendClickEvent();
@ -74,32 +65,8 @@ protected:
// set or unset BS_DEFPUSHBUTTON style
static void SetDefaultStyle(wxButton *btn, bool on);
// usually overridden base class virtuals
virtual wxSize DoGetBestSize() const;
virtual bool DoGetAuthNeeded() const;
virtual void DoSetAuthNeeded(bool show);
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual wxSize DoGetBitmapMargins() const;
virtual void DoSetBitmapMargins(wxCoord x, wxCoord y);
virtual void DoSetBitmapPosition(wxDirection dir);
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
// Increases the passed in size to account for the button image.
//
// Should only be called if we do have a button, i.e. if m_imageData is
// non-NULL.
void AdjustForBitmapSize(wxSize& size) const;
class wxButtonImageData *m_imageData;
#if wxUSE_MARKUP
class wxMarkupText *m_markupText;
#endif // wxUSE_MARKUP
// true if the UAC symbol is shown
bool m_authNeeded;
@ -107,19 +74,10 @@ protected:
private:
void Init()
{
m_imageData = NULL;
#if wxUSE_MARKUP
m_markupText = NULL;
#endif // wxUSE_MARKUP
m_authNeeded = false;
}
// Switches button into owner-drawn mode: this is used if we need to draw
// something not supported by the native control, such as using non default
// colours or a bitmap on pre-XP systems.
void MakeOwnerDrawn();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton);
};
#endif // _WX_BUTTON_H_
#endif // _WX_MSW_BUTTON_H_

View File

@ -15,71 +15,11 @@
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// wxBitmapToggleButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButtonBase
{
public:
// construction/destruction
wxBitmapToggleButton() { Init(); }
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
// Get/set the value
void SetValue(bool state);
bool GetValue() const;
// Set the label
virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }
virtual void SetLabel(const wxBitmap& label);
bool Enable(bool enable = true);
protected:
void Init();
wxBitmap m_bitmap;
wxBitmap m_disabledBitmap;
bool m_capturing;
bool m_depressed,m_oldValue;
void OnPaint(wxPaintEvent &event);
void OnMouse(wxMouseEvent &event);
void OnChar(wxKeyEvent &event);
void OnSize(wxSizeEvent &event);
virtual wxSize DoGetBestSize() const;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
};
// Checkbox item (single checkbox)
class WXDLLIMPEXP_CORE wxToggleButton : public wxToggleButtonBase
{
public:
wxToggleButton() {}
wxToggleButton() { Init(); }
wxToggleButton(wxWindow *parent,
wxWindowID id,
const wxString& label,
@ -104,23 +44,68 @@ public:
virtual void SetValue(bool value);
virtual bool GetValue() const ;
virtual void SetLabel(const wxString& label);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual void Command(wxCommandEvent& event);
virtual State GetNormalState() const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
void Init();
// current state of the button (when owner-drawn)
bool m_state;
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)
};
//-----------------------------------------------------------------------------
// wxBitmapToggleButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButton
{
public:
// construction/destruction
wxBitmapToggleButton() {}
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
// deprecated synonym for SetBitmapLabel()
wxDEPRECATED_INLINE( void SetLabel(const wxBitmap& bitmap),
SetBitmapLabel(bitmap); )
// prevent virtual function hiding
virtual void SetLabel(const wxString& label) { wxToggleButton::SetLabel(label); }
private:
DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
};
#endif // _WX_TOGGLEBUTTON_H_

View File

@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////
// Name: anybutton.h
// Purpose: wxAnyButton class
// Author: Stefan Csomor
// Created: 1998-01-01 (extracted from button.h)
// RCS-ID: $Id: anybutton.h 67069 2011-02-27 12:48:46Z VZ $
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_OSX_ANYBUTTON_H_
#define _WX_OSX_ANYBUTTON_H_
// Any button
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton() {}
static wxSize GetDefaultSize();
virtual void SetLabel(const wxString& label);
protected:
virtual wxSize DoGetBestSize() const ;
void OnEnterWindow( wxMouseEvent& event);
void OnLeaveWindow( wxMouseEvent& event);
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual void DoSetBitmapPosition(wxDirection dir);
virtual void DoSetBitmapMargins(int x, int y)
{
m_marginX = x;
m_marginY = y;
InvalidateBestSize();
}
#if wxUSE_MARKUP && wxOSX_USE_COCOA
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP && wxOSX_USE_COCOA
// the margins around the bitmap
int m_marginX;
int m_marginY;
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
wxBitmap m_bitmaps[State_Max];
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
DECLARE_EVENT_TABLE()
};
#endif // _WX_OSX_ANYBUTTON_H_

View File

@ -41,8 +41,6 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
static wxSize GetDefaultSize();
virtual void SetLabel(const wxString& label);
virtual wxWindow *SetDefault();
virtual void Command(wxCommandEvent& event);
@ -52,38 +50,7 @@ public:
virtual bool OSXHandleClicked( double timestampsec );
protected:
virtual wxSize DoGetBestSize() const ;
void OnEnterWindow( wxMouseEvent& event);
void OnLeaveWindow( wxMouseEvent& event);
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual void DoSetBitmapPosition(wxDirection dir);
virtual void DoSetBitmapMargins(int x, int y)
{
m_marginX = x;
m_marginY = y;
InvalidateBestSize();
}
#if wxUSE_MARKUP && wxOSX_USE_COCOA
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP && wxOSX_USE_COCOA
// the margins around the bitmap
int m_marginX;
int m_marginY;
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
wxBitmap m_bitmaps[State_Max];
DECLARE_DYNAMIC_CLASS(wxButton)
DECLARE_EVENT_TABLE()
};
// OS X specific class, not part of public wx API

View File

@ -13,53 +13,6 @@
#ifndef _WX_TOGGLEBUTTON_H_
#define _WX_TOGGLEBUTTON_H_
class WXDLLIMPEXP_CORE wxBitmapToggleButton : public wxToggleButtonBase
{
public:
wxBitmapToggleButton() {}
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool value);
virtual bool GetValue() const ;
virtual bool OSXHandleClicked( double timestampsec );
virtual void Command(wxCommandEvent& event);
private:
wxBitmap m_bitmap;
int m_marginX,
m_marginY;
protected:
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapToggleButton)
};
class WXDLLIMPEXP_CORE wxToggleButton : public wxToggleButtonBase
{
public:
@ -100,5 +53,38 @@ private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)
};
class WXDLLIMPEXP_CORE wxBitmapToggleButton : public wxToggleButton
{
public:
wxBitmapToggleButton() {}
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
protected:
virtual wxSize DoGetBestSize() const;
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapToggleButton)
};
#endif // _WX_TOGGLEBUTTON_H_

View File

@ -182,6 +182,13 @@
#include "wx/setup_gccxml.h"
#endif
/*
Convenience for any optional classes that use the wxAnyButton base class.
*/
#if wxUSE_TOGGLEBTN || wxUSE_BUTTON
#define wxHAS_ANY_BUTTON
#endif
/*
Hardware platform detection.

View File

@ -18,7 +18,7 @@
#if wxUSE_TOGGLEBTN
#include "wx/event.h"
#include "wx/control.h" // base class
#include "wx/anybutton.h" // base class
extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[];
@ -28,7 +28,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,
// wxToggleButtonBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxToggleButtonBase : public wxControl
class WXDLLIMPEXP_CORE wxToggleButtonBase : public wxAnyButton
{
public:
wxToggleButtonBase() { }

View File

@ -134,7 +134,8 @@ protected:
#if wxUSE_MARKUP
*m_chkUseMarkup,
#endif // wxUSE_MARKUP
*m_chkDefault;
*m_chkDefault,
*m_chkUseBitmapClass;
// more checkboxes for wxBitmapButton only
wxCheckBox *m_chkUsePressed,
@ -216,6 +217,7 @@ ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
m_chkUseMarkup =
#endif // wxUSE_MARKUP
m_chkDefault =
m_chkUseBitmapClass =
m_chkUsePressed =
m_chkUseFocused =
m_chkUseCurrent =
@ -252,6 +254,10 @@ void ButtonWidgetsPage::CreateContent()
#endif // wxUSE_MARKUP
m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default"));
m_chkUseBitmapClass = CreateCheckBoxAndAddToSizer(sizerLeft,
"Use wxBitmapButton");
m_chkUseBitmapClass->SetValue(true);
sizerLeft->AddSpacer(5);
wxSizer *sizerUseLabels =
@ -363,6 +369,7 @@ void ButtonWidgetsPage::Reset()
#if wxUSE_MARKUP
m_chkUseMarkup->SetValue(false);
#endif // wxUSE_MARKUP
m_chkUseBitmapClass->SetValue(true);
m_chkUsePressed->SetValue(true);
m_chkUseFocused->SetValue(true);
@ -449,8 +456,17 @@ void ButtonWidgetsPage::CreateButton()
{
showsBitmap = true;
wxBitmapButton *bbtn = new wxBitmapButton(this, ButtonPage_Button,
CreateBitmap(wxT("normal")));
wxButton *bbtn;
if ( m_chkUseBitmapClass->GetValue() )
{
bbtn = new wxBitmapButton(this, ButtonPage_Button,
CreateBitmap(wxT("normal")));
}
else
{
bbtn = new wxButton(this, ButtonPage_Button);
bbtn->SetBitmapLabel(CreateBitmap(wxT("normal")));
}
if ( m_chkUsePressed->GetValue() )
bbtn->SetBitmapPressed(CreateBitmap(wxT("pushed")));
if ( m_chkUseFocused->GetValue() )
@ -510,6 +526,8 @@ void ButtonWidgetsPage::CreateButton()
m_button->SetBitmapDisabled(wxArtProvider::GetIcon(wxART_MISSING_IMAGE, wxART_BUTTON));
}
m_chkUseBitmapClass->Enable(showsBitmap);
m_chkUsePressed->Enable(showsBitmap);
m_chkUseFocused->Enable(showsBitmap);
m_chkUseCurrent->Enable(showsBitmap);

View File

@ -32,11 +32,17 @@
// for all others, include the necessary headers
#ifndef WX_PRECOMP
#include "wx/sizer.h"
#include "wx/button.h"
#include "wx/checkbox.h"
#include "wx/radiobox.h"
#include "wx/statbox.h"
#include "wx/textctrl.h"
#endif
#include "wx/artprov.h"
#include "wx/sizer.h"
#include "wx/dcmemory.h"
#include "icons/toggle.xpm"
// ----------------------------------------------------------------------------
@ -51,6 +57,29 @@ enum
TogglePage_Picker
};
// radio boxes
enum
{
ToggleImagePos_Left,
ToggleImagePos_Right,
ToggleImagePos_Top,
ToggleImagePos_Bottom
};
enum
{
ToggleHAlign_Left,
ToggleHAlign_Centre,
ToggleHAlign_Right
};
enum
{
ToggleVAlign_Top,
ToggleVAlign_Centre,
ToggleVAlign_Bottom
};
// ----------------------------------------------------------------------------
// CheckBoxWidgetsPage
// ----------------------------------------------------------------------------
@ -68,6 +97,9 @@ public:
virtual void CreateContent();
protected:
// event handlers
void OnCheckOrRadioBox(wxCommandEvent& event);
// event handlers
void OnButtonReset(wxCommandEvent& event);
void OnButtonChangeLabel(wxCommandEvent& event);
@ -78,11 +110,41 @@ protected:
// (re)create the toggle
void CreateToggle();
// helper function: create a bitmap for wxBitmapToggleButton
wxBitmap CreateBitmap(const wxString& label);
// the controls
// ------------
#if wxUSE_MARKUP
wxCheckBox *m_chkUseMarkup;
#endif // wxUSE_MARKUP
#ifdef wxHAS_BITMAPTOGGLEBUTTON
// the check/radio boxes for styles
wxCheckBox *m_chkBitmapOnly,
*m_chkTextAndBitmap,
*m_chkFit,
*m_chkUseBitmapClass;
// more checkboxes for wxBitmapToggleButton only
wxCheckBox *m_chkUsePressed,
*m_chkUseFocused,
*m_chkUseCurrent,
*m_chkUseDisabled;
// and an image position choice used if m_chkTextAndBitmap is on
wxRadioBox *m_radioImagePos;
wxRadioBox *m_radioHAlign,
*m_radioVAlign;
#endif // wxHAS_BITMAPTOGGLEBUTTON
// the checkbox itself and the sizer it is in
#ifdef wxHAS_ANY_BUTTON
wxToggleButton *m_toggle;
#else
wxToggleButtonBase *m_toggle;
#endif // wxHAS_ANY_BUTTON
wxSizer *m_sizerToggle;
// the text entries for command parameters
@ -100,6 +162,9 @@ private:
BEGIN_EVENT_TABLE(ToggleWidgetsPage, WidgetsPage)
EVT_BUTTON(TogglePage_Reset, ToggleWidgetsPage::OnButtonReset)
EVT_BUTTON(TogglePage_ChangeLabel, ToggleWidgetsPage::OnButtonChangeLabel)
EVT_CHECKBOX(wxID_ANY, ToggleWidgetsPage::OnCheckOrRadioBox)
EVT_RADIOBOX(wxID_ANY, ToggleWidgetsPage::OnCheckOrRadioBox)
END_EVENT_TABLE()
// ============================================================================
@ -120,6 +185,29 @@ ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
:WidgetsPage(book, imaglist, toggle_xpm)
{
#if wxUSE_MARKUP
m_chkUseMarkup = (wxCheckBox *)NULL;
#endif // wxUSE_MARKUP
#ifdef wxHAS_BITMAPTOGGLEBUTTON
// init everything
m_chkBitmapOnly =
m_chkTextAndBitmap =
m_chkFit =
m_chkUseBitmapClass =
m_chkUsePressed =
m_chkUseFocused =
m_chkUseCurrent =
m_chkUseDisabled = (wxCheckBox *)NULL;
m_radioImagePos =
m_radioHAlign =
m_radioVAlign = (wxRadioBox *)NULL;
#endif // wxHAS_BITMAPTOGGLEBUTTON
m_textLabel = (wxTextCtrl *)NULL;
m_toggle = (wxToggleButton *)NULL;
m_sizerToggle = (wxSizer *)NULL;
}
void ToggleWidgetsPage::CreateContent()
@ -127,9 +215,81 @@ void ToggleWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
// wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Styles"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Styles"));
// wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
#ifdef wxHAS_BITMAPTOGGLEBUTTON
m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only");
m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap");
m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly"));
#endif // wxHAS_BITMAPTOGGLEBUTTON
#if wxUSE_MARKUP
m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup");
#endif // wxUSE_MARKUP
#ifdef wxHAS_BITMAPTOGGLEBUTTON
m_chkUseBitmapClass = CreateCheckBoxAndAddToSizer(sizerLeft,
"Use wxBitmapToggleButton");
m_chkUseBitmapClass->SetValue(true);
sizerLeft->AddSpacer(5);
wxSizer *sizerUseLabels =
new wxStaticBoxSizer(wxVERTICAL, this,
"&Use the following bitmaps in addition to the normal one?");
m_chkUsePressed = CreateCheckBoxAndAddToSizer(sizerUseLabels,
"&Pressed (small help icon)");
m_chkUseFocused = CreateCheckBoxAndAddToSizer(sizerUseLabels,
"&Focused (small error icon)");
m_chkUseCurrent = CreateCheckBoxAndAddToSizer(sizerUseLabels,
"&Current (small warning icon)");
m_chkUseDisabled = CreateCheckBoxAndAddToSizer(sizerUseLabels,
"&Disabled (broken image icon)");
sizerLeft->Add(sizerUseLabels, wxSizerFlags().Expand().Border());
sizerLeft->AddSpacer(10);
static const wxString dirs[] =
{
"left", "right", "top", "bottom",
};
m_radioImagePos = new wxRadioBox(this, wxID_ANY, "Image &position",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(dirs), dirs);
sizerLeft->Add(m_radioImagePos, 0, wxGROW | wxALL, 5);
sizerLeft->AddSpacer(15);
// should be in sync with enums Toggle[HV]Align!
static const wxString halign[] =
{
wxT("left"),
wxT("centre"),
wxT("right"),
};
static const wxString valign[] =
{
wxT("top"),
wxT("centre"),
wxT("bottom"),
};
m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign);
m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(valign), valign);
sizerLeft->Add(m_radioHAlign, 0, wxGROW | wxALL, 5);
sizerLeft->Add(m_radioVAlign, 0, wxGROW | wxALL, 5);
#endif // wxHAS_BITMAPTOGGLEBUTTON
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
wxButton *btn = new wxButton(this, TogglePage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
@ -144,48 +304,184 @@ void ToggleWidgetsPage::CreateContent()
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
// right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
m_toggle = new wxToggleButton(this, TogglePage_Picker, wxT("Toggle Button"));
sizerRight->Add(0, 0, 1, wxCENTRE);
sizerRight->Add(m_toggle, 1, wxCENTRE);
sizerRight->Add(0, 0, 1, wxCENTRE);
sizerRight->SetMinSize(150, 0);
m_sizerToggle = sizerRight; // save it to modify it later
m_sizerToggle = new wxBoxSizer(wxHORIZONTAL);
m_sizerToggle->SetMinSize(150, 0);
// the 3 panes panes compose the window
// sizerTop->Add(sizerLeft, 0, (wxALL & ~wxLEFT), 10);
sizerTop->Add(sizerLeft, 0, (wxALL & ~wxLEFT), 10);
sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10);
sizerTop->Add(sizerRight, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
sizerTop->Add(m_sizerToggle, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
// final initializations
// do create the main control
Reset();
CreateToggle();
SetSizer(sizerTop);
}
void ToggleWidgetsPage::Reset()
{
m_toggle->SetValue(false);
#ifdef wxHAS_BITMAPTOGGLEBUTTON
m_chkBitmapOnly->SetValue(false);
m_chkFit->SetValue(true);
m_chkTextAndBitmap->SetValue(false);
#if wxUSE_MARKUP
m_chkUseMarkup->SetValue(false);
#endif // wxUSE_MARKUP
m_chkUseBitmapClass->SetValue(true);
m_chkUsePressed->SetValue(true);
m_chkUseFocused->SetValue(true);
m_chkUseCurrent->SetValue(true);
m_chkUseDisabled->SetValue(true);
m_radioImagePos->SetSelection(ToggleImagePos_Left);
m_radioHAlign->SetSelection(ToggleHAlign_Centre);
m_radioVAlign->SetSelection(ToggleVAlign_Centre);
#endif // wxHAS_BITMAPTOGGLEBUTTON
if ( m_toggle )
{
m_toggle->SetValue(false);
}
}
void ToggleWidgetsPage::CreateToggle()
{
const bool value = m_toggle->GetValue();
wxString label;
bool value = false;
size_t count = m_sizerToggle->GetChildren().GetCount();
for ( size_t n = 0; n < count; n++ )
if ( m_toggle )
{
m_sizerToggle->Remove(0);
label = m_toggle->GetLabel();
value = m_toggle->GetValue();
size_t count = m_sizerToggle->GetChildren().GetCount();
for ( size_t n = 0; n < count; n++ )
{
m_sizerToggle->Remove(0);
}
delete m_toggle;
}
delete m_toggle;
if ( label.empty() )
{
// creating for the first time or recreating a toggle button after bitmap
// button
label = m_textLabel->GetValue();
}
m_toggle = new wxToggleButton(this, TogglePage_Picker, wxT("Toggle Button"));
int flags = ms_defaultFlags;
#ifdef wxHAS_BITMAPTOGGLEBUTTON
switch ( m_radioHAlign->GetSelection() )
{
case ToggleHAlign_Left:
flags |= wxBU_LEFT;
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case ToggleHAlign_Centre:
break;
case ToggleHAlign_Right:
flags |= wxBU_RIGHT;
break;
}
switch ( m_radioVAlign->GetSelection() )
{
case ToggleVAlign_Top:
flags |= wxBU_TOP;
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case ToggleVAlign_Centre:
// centre vertical alignment is the default (no style)
break;
case ToggleVAlign_Bottom:
flags |= wxBU_BOTTOM;
break;
}
#endif // wxHAS_BITMAPTOGGLEBUTTON
#ifdef wxHAS_BITMAPTOGGLEBUTTON
bool showsBitmap = false;
if ( m_chkBitmapOnly->GetValue() )
{
showsBitmap = true;
wxToggleButton *btgl;
if ( m_chkUseBitmapClass->GetValue() )
{
btgl = new wxBitmapToggleButton(this, TogglePage_Picker,
CreateBitmap(wxT("normal")));
}
else
{
btgl = new wxToggleButton(this, TogglePage_Picker, wxT(""));
btgl->SetBitmapLabel(CreateBitmap(wxT("normal")));
}
#ifdef wxHAS_ANY_BUTTON
if ( m_chkUsePressed->GetValue() )
btgl->SetBitmapPressed(CreateBitmap(wxT("pushed")));
if ( m_chkUseFocused->GetValue() )
btgl->SetBitmapFocus(CreateBitmap(wxT("focused")));
if ( m_chkUseCurrent->GetValue() )
btgl->SetBitmapCurrent(CreateBitmap(wxT("hover")));
if ( m_chkUseDisabled->GetValue() )
btgl->SetBitmapDisabled(CreateBitmap(wxT("disabled")));
#endif // wxHAS_ANY_BUTTON
m_toggle = btgl;
}
else // normal button
#endif // wxHAS_BITMAPTOGGLEBUTTON
{
m_toggle = new wxToggleButton(this, TogglePage_Picker, label,
wxDefaultPosition, wxDefaultSize,
flags);
}
m_toggle->SetValue(value);
#ifdef wxHAS_BITMAPTOGGLEBUTTON
#ifdef wxHAS_ANY_BUTTON
if ( !showsBitmap && m_chkTextAndBitmap->GetValue() )
{
showsBitmap = true;
static const wxDirection positions[] =
{
wxLEFT, wxRIGHT, wxTOP, wxBOTTOM
};
m_toggle->SetBitmap(wxArtProvider::GetIcon(wxART_INFORMATION, wxART_BUTTON),
positions[m_radioImagePos->GetSelection()]);
if ( m_chkUsePressed->GetValue() )
m_toggle->SetBitmapPressed(wxArtProvider::GetIcon(wxART_HELP, wxART_BUTTON));
if ( m_chkUseFocused->GetValue() )
m_toggle->SetBitmapFocus(wxArtProvider::GetIcon(wxART_ERROR, wxART_BUTTON));
if ( m_chkUseCurrent->GetValue() )
m_toggle->SetBitmapCurrent(wxArtProvider::GetIcon(wxART_WARNING, wxART_BUTTON));
if ( m_chkUseDisabled->GetValue() )
m_toggle->SetBitmapDisabled(wxArtProvider::GetIcon(wxART_MISSING_IMAGE, wxART_BUTTON));
}
#endif // wxHAS_ANY_BUTTON
m_chkUseBitmapClass->Enable(showsBitmap);
m_chkUsePressed->Enable(showsBitmap);
m_chkUseFocused->Enable(showsBitmap);
m_chkUseCurrent->Enable(showsBitmap);
m_chkUseDisabled->Enable(showsBitmap);
#endif // wxHAS_BITMAPTOGGLEBUTTON
m_sizerToggle->Add(0, 0, 1, wxCENTRE);
m_sizerToggle->Add(m_toggle, 1, wxCENTRE);
m_sizerToggle->Add(0, 0, 1, wxCENTRE);
@ -203,9 +499,44 @@ void ToggleWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
CreateToggle();
}
void ToggleWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event))
void ToggleWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
{
m_toggle->SetLabel(m_textLabel->GetValue());
CreateToggle();
}
void ToggleWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event))
{
const wxString labelText = m_textLabel->GetValue();
#if wxUSE_MARKUP
if ( m_chkUseMarkup->GetValue() )
m_toggle->SetLabelMarkup(labelText);
else
#endif // wxUSE_MARKUP
m_toggle->SetLabel(labelText);
}
#ifdef wxHAS_BITMAPTOGGLEBUTTON
// ----------------------------------------------------------------------------
// bitmap toggle button stuff
// ----------------------------------------------------------------------------
wxBitmap ToggleWidgetsPage::CreateBitmap(const wxString& label)
{
wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this
wxMemoryDC dc;
dc.SelectObject(bmp);
dc.SetBackground(wxBrush(*wxCYAN));
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
wxT("(") + label + wxT(" state)"),
wxArtProvider::GetBitmap(wxART_INFORMATION),
wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20),
wxALIGN_CENTRE);
return bmp;
}
#endif // wxHAS_BITMAPTOGGLEBUTTON
#endif // wxUSE_TOGGLEBTN

View File

@ -107,7 +107,7 @@ wxWindow *wxButtonBase::SetDefault()
return tlw->SetDefaultItem(this);
}
void wxButtonBase::SetBitmapPosition(wxDirection dir)
void wxAnyButtonBase::SetBitmapPosition(wxDirection dir)
{
wxASSERT_MSG( !(dir & ~wxDIRECTION_MASK), "non-direction flag used" );
wxASSERT_MSG( !!(dir & wxLEFT) +

422
src/gtk/anybutton.cpp Normal file
View File

@ -0,0 +1,422 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/gtk/anybutton.cpp
// Purpose:
// Author: Robert Roebling
// Created: 1998-05-20 (extracted from button.cpp)
// Id: $Id: anybutton.cpp 67326 2011-03-28 06:27:49Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef wxHAS_ANY_BUTTON
#ifndef WX_PRECOMP
#include "wx/anybutton.h"
#endif
#include "wx/stockitem.h"
#include "wx/gtk/private.h"
// ----------------------------------------------------------------------------
// GTK callbacks
// ----------------------------------------------------------------------------
extern "C"
{
static void
wxgtk_button_enter_callback(GtkWidget *WXUNUSED(widget), wxAnyButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKMouseEnters();
}
static void
wxgtk_button_leave_callback(GtkWidget *WXUNUSED(widget), wxAnyButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKMouseLeaves();
}
static void
wxgtk_button_press_callback(GtkWidget *WXUNUSED(widget), wxAnyButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKPressed();
}
static void
wxgtk_button_released_callback(GtkWidget *WXUNUSED(widget), wxAnyButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKReleased();
}
} // extern "C"
//-----------------------------------------------------------------------------
// wxAnyButton
//-----------------------------------------------------------------------------
bool wxAnyButton::Enable( bool enable )
{
if (!base_type::Enable(enable))
return false;
gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(m_widget)), enable);
if (enable)
GTKFixSensitivity();
GTKUpdateBitmap();
return true;
}
GdkWindow *wxAnyButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
{
return GTK_BUTTON(m_widget)->event_window;
}
// static
wxVisualAttributes
wxAnyButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
return GetDefaultAttributesFromGTKWidget(gtk_button_new);
}
// ----------------------------------------------------------------------------
// bitmaps support
// ----------------------------------------------------------------------------
void wxAnyButton::GTKMouseEnters()
{
m_isCurrent = true;
GTKUpdateBitmap();
}
void wxAnyButton::GTKMouseLeaves()
{
m_isCurrent = false;
GTKUpdateBitmap();
}
void wxAnyButton::GTKPressed()
{
m_isPressed = true;
GTKUpdateBitmap();
}
void wxAnyButton::GTKReleased()
{
m_isPressed = false;
GTKUpdateBitmap();
}
void wxAnyButton::GTKOnFocus(wxFocusEvent& event)
{
event.Skip();
GTKUpdateBitmap();
}
wxAnyButton::State wxAnyButton::GTKGetCurrentState() const
{
if ( !IsThisEnabled() )
return m_bitmaps[State_Disabled].IsOk() ? State_Disabled : State_Normal;
if ( m_isPressed && m_bitmaps[State_Pressed].IsOk() )
return State_Pressed;
if ( m_isCurrent && m_bitmaps[State_Current].IsOk() )
return State_Current;
if ( HasFocus() && m_bitmaps[State_Focused].IsOk() )
return State_Focused;
return State_Normal;
}
void wxAnyButton::GTKUpdateBitmap()
{
// if we don't show bitmaps at all, there is nothing to update
if ( m_bitmaps[State_Normal].IsOk() )
{
// if we do show them, this will return a state for which we do have a
// valid bitmap
State state = GTKGetCurrentState();
GTKDoShowBitmap(m_bitmaps[state]);
}
}
void wxAnyButton::GTKDoShowBitmap(const wxBitmap& bitmap)
{
wxASSERT_MSG( bitmap.IsOk(), "invalid bitmap" );
GtkWidget *image;
if ( DontShowLabel() )
{
image = gtk_bin_get_child(GTK_BIN(m_widget));
}
else // have both label and bitmap
{
#ifdef __WXGTK26__
if ( !gtk_check_version(2,6,0) )
{
image = gtk_button_get_image(GTK_BUTTON(m_widget));
}
else
#endif // __WXGTK26__
{
// buttons with both label and bitmap are only supported with GTK+
// 2.6 so far
//
// it shouldn't be difficult to implement them ourselves for the
// previous GTK+ versions by stuffing a container with a label and
// an image inside GtkButton but there doesn't seem to be much
// point in doing this for ancient GTK+ versions
return;
}
}
wxCHECK_RET( image && GTK_IS_IMAGE(image), "must have image widget" );
gtk_image_set_from_pixbuf(GTK_IMAGE(image), bitmap.GetPixbuf());
}
wxBitmap wxAnyButton::DoGetBitmap(State which) const
{
return m_bitmaps[which];
}
void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which)
{
switch ( which )
{
case State_Normal:
if ( DontShowLabel() )
{
// we only have the bitmap in this button, never remove it but
// do invalidate the best size when the bitmap (and presumably
// its size) changes
InvalidateBestSize();
}
#ifdef __WXGTK26__
// normal image is special: setting it enables images for the button and
// resetting it to nothing disables all of them
else if ( !gtk_check_version(2,6,0) )
{
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(m_widget));
if ( image && !bitmap.IsOk() )
{
gtk_container_remove(GTK_CONTAINER(m_widget), image);
}
else if ( !image && bitmap.IsOk() )
{
image = gtk_image_new();
gtk_button_set_image(GTK_BUTTON(m_widget), image);
}
else // image presence or absence didn't change
{
// don't invalidate best size below
break;
}
InvalidateBestSize();
}
#endif // GTK+ 2.6+
break;
case State_Pressed:
if ( bitmap.IsOk() )
{
if ( !m_bitmaps[which].IsOk() )
{
// we need to install the callbacks to be notified about
// the button pressed state change
g_signal_connect
(
m_widget,
"pressed",
G_CALLBACK(wxgtk_button_press_callback),
this
);
g_signal_connect
(
m_widget,
"released",
G_CALLBACK(wxgtk_button_released_callback),
this
);
}
}
else // no valid bitmap
{
if ( m_bitmaps[which].IsOk() )
{
// we don't need to be notified about the button pressed
// state changes any more
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_press_callback,
this
);
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_released_callback,
this
);
// also make sure we don't remain stuck in pressed state
if ( m_isPressed )
{
m_isPressed = false;
GTKUpdateBitmap();
}
}
}
break;
case State_Current:
// the logic here is the same as above for State_Pressed: we need
// to connect the handlers if we must be notified about the changes
// in the button current state and we disconnect them when/if we
// don't need them any more
if ( bitmap.IsOk() )
{
if ( !m_bitmaps[which].IsOk() )
{
g_signal_connect
(
m_widget,
"enter",
G_CALLBACK(wxgtk_button_enter_callback),
this
);
g_signal_connect
(
m_widget,
"leave",
G_CALLBACK(wxgtk_button_leave_callback),
this
);
}
}
else // no valid bitmap
{
if ( m_bitmaps[which].IsOk() )
{
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_enter_callback,
this
);
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_leave_callback,
this
);
if ( m_isCurrent )
{
m_isCurrent = false;
GTKUpdateBitmap();
}
}
}
break;
case State_Focused:
if ( bitmap.IsOk() )
{
Connect(wxEVT_SET_FOCUS,
wxFocusEventHandler(wxAnyButton::GTKOnFocus));
Connect(wxEVT_KILL_FOCUS,
wxFocusEventHandler(wxAnyButton::GTKOnFocus));
}
else // no valid focused bitmap
{
Disconnect(wxEVT_SET_FOCUS,
wxFocusEventHandler(wxAnyButton::GTKOnFocus));
Disconnect(wxEVT_KILL_FOCUS,
wxFocusEventHandler(wxAnyButton::GTKOnFocus));
}
break;
default:
// no callbacks to connect/disconnect
;
}
m_bitmaps[which] = bitmap;
// update the bitmap immediately if necessary, otherwise it will be done
// when the bitmap for the corresponding state is needed the next time by
// GTKUpdateBitmap()
if ( bitmap.IsOk() && which == GTKGetCurrentState() )
{
GTKDoShowBitmap(bitmap);
}
}
void wxAnyButton::DoSetBitmapPosition(wxDirection dir)
{
#ifdef __WXGTK210__
if ( !gtk_check_version(2,10,0) )
{
GtkPositionType gtkpos;
switch ( dir )
{
default:
wxFAIL_MSG( "invalid position" );
// fall through
case wxLEFT:
gtkpos = GTK_POS_LEFT;
break;
case wxRIGHT:
gtkpos = GTK_POS_RIGHT;
break;
case wxTOP:
gtkpos = GTK_POS_TOP;
break;
case wxBOTTOM:
gtkpos = GTK_POS_BOTTOM;
break;
}
gtk_button_set_image_position(GTK_BUTTON(m_widget), gtkpos);
InvalidateBestSize();
}
#endif // GTK+ 2.10+
}
#endif // wxHAS_ANY_BUTTON

View File

@ -38,42 +38,6 @@ wxgtk_button_clicked_callback(GtkWidget *WXUNUSED(widget), wxButton *button)
button->HandleWindowEvent(event);
}
static void
wxgtk_button_enter_callback(GtkWidget *WXUNUSED(widget), wxButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKMouseEnters();
}
static void
wxgtk_button_leave_callback(GtkWidget *WXUNUSED(widget), wxButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKMouseLeaves();
}
static void
wxgtk_button_press_callback(GtkWidget *WXUNUSED(widget), wxButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKPressed();
}
static void
wxgtk_button_released_callback(GtkWidget *WXUNUSED(widget), wxButton *button)
{
if ( button->GTKShouldIgnoreEvent() )
return;
button->GTKReleased();
}
//-----------------------------------------------------------------------------
// "style_set" from m_widget
//-----------------------------------------------------------------------------
@ -234,7 +198,7 @@ void wxButton::SetLabel( const wxString &lbl )
if (label.empty() && wxIsStockID(m_windowId))
label = wxGetStockLabel(m_windowId);
wxControl::SetLabel(label);
wxAnyButton::SetLabel(label);
// don't use label if it was explicitly disabled
if ( HasFlag(wxBU_NOTEXT) )
@ -282,26 +246,6 @@ bool wxButton::DoSetLabelMarkup(const wxString& markup)
}
#endif // wxUSE_MARKUP
bool wxButton::Enable( bool enable )
{
if (!base_type::Enable(enable))
return false;
gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(m_widget)), enable);
if (enable)
GTKFixSensitivity();
GTKUpdateBitmap();
return true;
}
GdkWindow *wxButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
{
return GTK_BUTTON(m_widget)->event_window;
}
GtkLabel *wxButton::GTKGetLabel() const
{
GtkWidget* child = gtk_bin_get_child(GTK_BIN(m_widget));
@ -361,7 +305,7 @@ wxSize wxButton::DoGetBestSize() const
gtk_widget_set_can_default(m_widget, FALSE);
}
wxSize ret( wxControl::DoGetBestSize() );
wxSize ret( wxAnyButton::DoGetBestSize() );
if ( isDefault )
{
@ -389,326 +333,4 @@ wxButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
return GetDefaultAttributesFromGTKWidget(gtk_button_new);
}
// ----------------------------------------------------------------------------
// bitmaps support
// ----------------------------------------------------------------------------
void wxButton::GTKMouseEnters()
{
m_isCurrent = true;
GTKUpdateBitmap();
}
void wxButton::GTKMouseLeaves()
{
m_isCurrent = false;
GTKUpdateBitmap();
}
void wxButton::GTKPressed()
{
m_isPressed = true;
GTKUpdateBitmap();
}
void wxButton::GTKReleased()
{
m_isPressed = false;
GTKUpdateBitmap();
}
void wxButton::GTKOnFocus(wxFocusEvent& event)
{
event.Skip();
GTKUpdateBitmap();
}
wxButton::State wxButton::GTKGetCurrentState() const
{
if ( !IsThisEnabled() )
return m_bitmaps[State_Disabled].IsOk() ? State_Disabled : State_Normal;
if ( m_isPressed && m_bitmaps[State_Pressed].IsOk() )
return State_Pressed;
if ( m_isCurrent && m_bitmaps[State_Current].IsOk() )
return State_Current;
if ( HasFocus() && m_bitmaps[State_Focused].IsOk() )
return State_Focused;
return State_Normal;
}
void wxButton::GTKUpdateBitmap()
{
// if we don't show bitmaps at all, there is nothing to update
if ( m_bitmaps[State_Normal].IsOk() )
{
// if we do show them, this will return a state for which we do have a
// valid bitmap
State state = GTKGetCurrentState();
GTKDoShowBitmap(m_bitmaps[state]);
}
}
void wxButton::GTKDoShowBitmap(const wxBitmap& bitmap)
{
wxASSERT_MSG( bitmap.IsOk(), "invalid bitmap" );
GtkWidget *image;
if ( DontShowLabel() )
{
image = gtk_bin_get_child(GTK_BIN(m_widget));
}
else // have both label and bitmap
{
#ifdef __WXGTK26__
if ( !gtk_check_version(2,6,0) )
{
image = gtk_button_get_image(GTK_BUTTON(m_widget));
}
else
#endif // __WXGTK26__
{
// buttons with both label and bitmap are only supported with GTK+
// 2.6 so far
//
// it shouldn't be difficult to implement them ourselves for the
// previous GTK+ versions by stuffing a container with a label and
// an image inside GtkButton but there doesn't seem to be much
// point in doing this for ancient GTK+ versions
return;
}
}
wxCHECK_RET( image && GTK_IS_IMAGE(image), "must have image widget" );
gtk_image_set_from_pixbuf(GTK_IMAGE(image), bitmap.GetPixbuf());
}
wxBitmap wxButton::DoGetBitmap(State which) const
{
return m_bitmaps[which];
}
void wxButton::DoSetBitmap(const wxBitmap& bitmap, State which)
{
switch ( which )
{
case State_Normal:
if ( DontShowLabel() )
{
// we only have the bitmap in this button, never remove it but
// do invalidate the best size when the bitmap (and presumably
// its size) changes
InvalidateBestSize();
}
#ifdef __WXGTK26__
// normal image is special: setting it enables images for the button and
// resetting it to nothing disables all of them
else if ( !gtk_check_version(2,6,0) )
{
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(m_widget));
if ( image && !bitmap.IsOk() )
{
gtk_container_remove(GTK_CONTAINER(m_widget), image);
}
else if ( !image && bitmap.IsOk() )
{
image = gtk_image_new();
gtk_button_set_image(GTK_BUTTON(m_widget), image);
}
else // image presence or absence didn't change
{
// don't invalidate best size below
break;
}
InvalidateBestSize();
}
#endif // GTK+ 2.6+
break;
case State_Pressed:
if ( bitmap.IsOk() )
{
if ( !m_bitmaps[which].IsOk() )
{
// we need to install the callbacks to be notified about
// the button pressed state change
g_signal_connect
(
m_widget,
"pressed",
G_CALLBACK(wxgtk_button_press_callback),
this
);
g_signal_connect
(
m_widget,
"released",
G_CALLBACK(wxgtk_button_released_callback),
this
);
}
}
else // no valid bitmap
{
if ( m_bitmaps[which].IsOk() )
{
// we don't need to be notified about the button pressed
// state changes any more
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_press_callback,
this
);
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_released_callback,
this
);
// also make sure we don't remain stuck in pressed state
if ( m_isPressed )
{
m_isPressed = false;
GTKUpdateBitmap();
}
}
}
break;
case State_Current:
// the logic here is the same as above for State_Pressed: we need
// to connect the handlers if we must be notified about the changes
// in the button current state and we disconnect them when/if we
// don't need them any more
if ( bitmap.IsOk() )
{
if ( !m_bitmaps[which].IsOk() )
{
g_signal_connect
(
m_widget,
"enter",
G_CALLBACK(wxgtk_button_enter_callback),
this
);
g_signal_connect
(
m_widget,
"leave",
G_CALLBACK(wxgtk_button_leave_callback),
this
);
}
}
else // no valid bitmap
{
if ( m_bitmaps[which].IsOk() )
{
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_enter_callback,
this
);
g_signal_handlers_disconnect_by_func
(
m_widget,
(gpointer)wxgtk_button_leave_callback,
this
);
if ( m_isCurrent )
{
m_isCurrent = false;
GTKUpdateBitmap();
}
}
}
break;
case State_Focused:
if ( bitmap.IsOk() )
{
Connect(wxEVT_SET_FOCUS,
wxFocusEventHandler(wxButton::GTKOnFocus));
Connect(wxEVT_KILL_FOCUS,
wxFocusEventHandler(wxButton::GTKOnFocus));
}
else // no valid focused bitmap
{
Disconnect(wxEVT_SET_FOCUS,
wxFocusEventHandler(wxButton::GTKOnFocus));
Disconnect(wxEVT_KILL_FOCUS,
wxFocusEventHandler(wxButton::GTKOnFocus));
}
break;
default:
// no callbacks to connect/disconnect
;
}
m_bitmaps[which] = bitmap;
// update the bitmap immediately if necessary, otherwise it will be done
// when the bitmap for the corresponding state is needed the next time by
// GTKUpdateBitmap()
if ( bitmap.IsOk() && which == GTKGetCurrentState() )
{
GTKDoShowBitmap(bitmap);
}
}
void wxButton::DoSetBitmapPosition(wxDirection dir)
{
#ifdef __WXGTK210__
if ( !gtk_check_version(2,10,0) )
{
GtkPositionType gtkpos;
switch ( dir )
{
default:
wxFAIL_MSG( "invalid position" );
// fall through
case wxLEFT:
gtkpos = GTK_POS_LEFT;
break;
case wxRIGHT:
gtkpos = GTK_POS_RIGHT;
break;
case wxTOP:
gtkpos = GTK_POS_TOP;
break;
case wxBOTTOM:
gtkpos = GTK_POS_BOTTOM;
break;
}
gtk_button_set_image_position(GTK_BUTTON(m_widget), gtkpos);
InvalidateBestSize();
}
#endif // GTK+ 2.10+
}
#endif // wxUSE_BUTTON

View File

@ -45,157 +45,30 @@ wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent );
// wxBitmapToggleButton
// ------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButton)
bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id,
const wxBitmap &label, const wxPoint &pos,
const wxBitmap &bitmap, const wxPoint &pos,
const wxSize &size, long style,
const wxValidator& validator,
const wxString &name)
{
if (!PreCreation(parent, pos, size) ||
!CreateBase(parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG(wxT("wxBitmapToggleButton creation failed"));
return false;
}
// Create the gtk widget.
m_widget = gtk_toggle_button_new();
g_object_ref(m_widget);
if (style & wxNO_BORDER)
gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE );
m_bitmap = label;
OnSetBitmap();
g_signal_connect (m_widget, "clicked",
G_CALLBACK (gtk_togglebutton_clicked_callback),
this);
m_parent->DoAddChild(this);
PostCreation(size);
return true;
}
void wxBitmapToggleButton::GTKDisableEvents()
{
g_signal_handlers_block_by_func(m_widget,
(gpointer) gtk_togglebutton_clicked_callback, this);
}
void wxBitmapToggleButton::GTKEnableEvents()
{
g_signal_handlers_unblock_by_func(m_widget,
(gpointer) gtk_togglebutton_clicked_callback, this);
}
// void SetValue(bool state)
// Set the value of the toggle button.
void wxBitmapToggleButton::SetValue(bool state)
{
wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
if (state == GetValue())
return;
GTKDisableEvents();
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
GTKEnableEvents();
}
// bool GetValue() const
// Get the value of the toggle button.
bool wxBitmapToggleButton::GetValue() const
{
wxCHECK_MSG(m_widget != NULL, false, wxT("invalid toggle button"));
return gtk_toggle_button_get_active((GtkToggleButton*)m_widget);
}
void wxBitmapToggleButton::SetLabel(const wxBitmap& label)
{
wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
m_bitmap = label;
InvalidateBestSize();
OnSetBitmap();
}
void wxBitmapToggleButton::OnSetBitmap()
{
if (!m_bitmap.IsOk()) return;
GtkWidget* image = gtk_bin_get_child(GTK_BIN(m_widget));
if (image == NULL)
{
image = gtk_image_new();
gtk_widget_show(image);
gtk_container_add((GtkContainer*)m_widget, image);
}
// always use pixbuf, because pixmap mask does not
// work with disabled images in some themes
gtk_image_set_from_pixbuf((GtkImage*)image, m_bitmap.GetPixbuf());
}
bool wxBitmapToggleButton::Enable(bool enable /*=true*/)
{
bool isEnabled = IsEnabled();
if (!wxControl::Enable(enable))
if ( !wxToggleButton::Create(parent, id, wxEmptyString, pos, size, style | wxBU_NOTEXT | wxBU_EXACTFIT,
validator, name) )
return false;
gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(m_widget)), enable);
if (!isEnabled && enable)
if ( bitmap.IsOk() )
{
GTKFixSensitivity();
SetBitmapLabel(bitmap);
// we need to adjust the size after setting the bitmap as it may be too
// big for the default button size
SetInitialSize(size);
}
return true;
}
void wxBitmapToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
gtk_widget_modify_style(m_widget, style);
gtk_widget_modify_style(gtk_bin_get_child(GTK_BIN(m_widget)), style);
}
GdkWindow *
wxBitmapToggleButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
{
return GTK_BUTTON(m_widget)->event_window;
}
// Get the "best" size for this control.
wxSize wxBitmapToggleButton::DoGetBestSize() const
{
wxSize best;
if (m_bitmap.IsOk())
{
int border = HasFlag(wxNO_BORDER) ? 4 : 10;
best.x = m_bitmap.GetWidth()+border;
best.y = m_bitmap.GetHeight()+border;
}
CacheBestSize(best);
return best;
}
// static
wxVisualAttributes
wxBitmapToggleButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
return GetDefaultAttributesFromGTKWidget(gtk_toggle_button_new);
}
// ------------------------------------------------------------------------
// wxToggleButton
@ -216,11 +89,28 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
return false;
}
// Create the gtk widget.
m_widget = gtk_toggle_button_new_with_mnemonic("");
// create either a standard toggle button with text label (which may still contain
// an image under GTK+ 2.6+) or a bitmap-only toggle button if we don't have any
// label
const bool
useLabel = !(style & wxBU_NOTEXT) && !label.empty();
if ( useLabel )
{
m_widget = gtk_toggle_button_new_with_mnemonic("");
}
else // no label, suppose we will have a bitmap
{
m_widget = gtk_toggle_button_new();
GtkWidget *image = gtk_image_new();
gtk_widget_show(image);
gtk_container_add(GTK_CONTAINER(m_widget), image);
}
g_object_ref(m_widget);
SetLabel(label);
if ( useLabel )
SetLabel(label);
g_signal_connect (m_widget, "clicked",
G_CALLBACK (gtk_togglebutton_clicked_callback),
@ -274,7 +164,7 @@ void wxToggleButton::SetLabel(const wxString& label)
{
wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
wxControl::SetLabel(label);
wxAnyButton::SetLabel(label);
const wxString labelGTK = GTKConvertMnemonics(label);
@ -283,18 +173,31 @@ void wxToggleButton::SetLabel(const wxString& label)
GTKApplyWidgetStyle( false );
}
bool wxToggleButton::Enable(bool enable /*=true*/)
#if wxUSE_MARKUP
bool wxToggleButton::DoSetLabelMarkup(const wxString& markup)
{
if (!base_type::Enable(enable))
wxCHECK_MSG( m_widget != NULL, false, "invalid toggle button" );
const wxString stripped = RemoveMarkup(markup);
if ( stripped.empty() && !markup.empty() )
return false;
gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(m_widget)), enable);
wxControl::SetLabel(stripped);
if (enable)
GTKFixSensitivity();
GtkLabel * const label = GTKGetLabel();
wxCHECK_MSG( label, false, "no label in this toggle button?" );
GTKSetLabelWithMarkupForLabel(label, markup);
return true;
}
#endif // wxUSE_MARKUP
GtkLabel *wxToggleButton::GTKGetLabel() const
{
GtkWidget* child = gtk_bin_get_child(GTK_BIN(m_widget));
return GTK_LABEL(child);
}
void wxToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
@ -302,16 +205,10 @@ void wxToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
gtk_widget_modify_style(gtk_bin_get_child(GTK_BIN(m_widget)), style);
}
GdkWindow *
wxToggleButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
{
return GTK_BUTTON(m_widget)->event_window;
}
// Get the "best" size for this control.
wxSize wxToggleButton::DoGetBestSize() const
{
wxSize ret(wxControl::DoGetBestSize());
wxSize ret(wxAnyButton::DoGetBestSize());
if (!HasFlag(wxBU_EXACTFIT))
{

1232
src/msw/anybutton.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -93,54 +93,4 @@ bool wxBitmapButton::Create(wxWindow *parent,
return true;
}
void wxBitmapButton::DoSetBitmap(const wxBitmap& bitmap, State which)
{
if ( bitmap.IsOk() )
{
switch ( which )
{
#if wxUSE_IMAGE
case State_Normal:
if ( !HasFlag(wxBU_AUTODRAW) && !m_disabledSetByUser )
{
wxImage img(bitmap.ConvertToImage().ConvertToGreyscale());
wxBitmapButtonBase::DoSetBitmap(img, State_Disabled);
}
break;
#endif // wxUSE_IMAGE
case State_Focused:
// if the focus bitmap is specified but current one isn't, use
// the focus bitmap for hovering as well if this is consistent
// with the current Windows version look and feel
//
// rationale: this is compatible with the old wxGTK behaviour
// and also makes it much easier to do "the right thing" for
// all platforms (some of them, such as Windows XP, have "hot"
// buttons while others don't)
if ( !m_hoverSetByUser )
wxBitmapButtonBase::DoSetBitmap(bitmap, State_Current);
break;
case State_Current:
// don't overwrite it with the focused bitmap
m_hoverSetByUser = true;
break;
case State_Disabled:
// don't overwrite it with the version automatically created
// from the normal one
m_disabledSetByUser = true;
break;
default:
// nothing special to do but include the default clause to
// suppress gcc warnings
;
}
}
wxBitmapButtonBase::DoSetBitmap(bitmap, which);
}
#endif // wxUSE_BMPBUTTON

File diff suppressed because it is too large Load Diff

View File

@ -38,9 +38,6 @@
#include "wx/log.h"
#endif // WX_PRECOMP
#include "wx/renderer.h"
#include "wx/dcclient.h"
#include "wx/msw/private.h"
#include "wx/msw/private/button.h"
@ -58,32 +55,16 @@ wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent );
// wxBitmapToggleButton
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxControl)
BEGIN_EVENT_TABLE(wxBitmapToggleButton,wxToggleButtonBase)
EVT_PAINT(wxBitmapToggleButton::OnPaint)
EVT_MOUSE_EVENTS(wxBitmapToggleButton::OnMouse)
EVT_CHAR(wxBitmapToggleButton::OnChar)
EVT_SIZE(wxBitmapToggleButton::OnSize)
END_EVENT_TABLE()
void wxBitmapToggleButton::Init()
{
m_depressed = false;
m_oldValue = false;
m_capturing = false;
}
IMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButton)
bool wxBitmapToggleButton::Create( wxWindow *parent, wxWindowID id,
const wxBitmap& label,const wxPoint& pos, const wxSize& size, long style,
const wxValidator& validator, const wxString& name )
{
Init();
if (!wxToggleButtonBase::Create( parent, id, pos, size, style, validator, name ))
if (!wxToggleButton::Create( parent, id, wxEmptyString, pos, size, style, validator, name ))
return false;
m_bitmap = label;
SetBitmap(label);
if (size.x == -1 || size.y == -1)
{
@ -98,152 +79,6 @@ bool wxBitmapToggleButton::Create( wxWindow *parent, wxWindowID id,
return true;
}
void wxBitmapToggleButton::SetValue(bool state)
{
if (m_capturing) return;
if (state == m_depressed) return;
m_depressed = state;
Refresh();
}
bool wxBitmapToggleButton::GetValue() const
{
return m_depressed;
}
void wxBitmapToggleButton::SetLabel(const wxBitmap& label)
{
m_bitmap = label;
m_disabledBitmap = wxBitmap();
Refresh();
}
bool wxBitmapToggleButton::Enable(bool enable)
{
if (m_capturing) return false;
if (!wxToggleButtonBase::Enable( enable ))
return false;
Refresh();
return true;
}
void wxBitmapToggleButton::OnPaint(wxPaintEvent &WXUNUSED(event))
{
wxSize size = GetSize();
wxBitmap bitmap = m_bitmap;
wxPaintDC dc(this);
wxRendererNative &renderer = wxRendererNative::Get();
int flags = 0;
if (m_depressed)
flags |= wxCONTROL_PRESSED;
wxRect rect(0,0,size.x,size.y);
renderer.DrawPushButton( this, dc, rect, flags );
if (bitmap.IsOk())
{
if (!IsEnabled())
{
if (!m_disabledBitmap.IsOk())
{
wxImage image = m_bitmap.ConvertToImage();
m_disabledBitmap = wxBitmap( image.ConvertToGreyscale() );
}
bitmap = m_disabledBitmap;
}
wxSize bsize = bitmap.GetSize();
int offset = 0;
if (m_depressed) offset = 1;
dc.DrawBitmap( bitmap, (size.x-bsize.x) / 2 + offset, (size.y-bsize.y) / 2 + offset, true );
}
}
void wxBitmapToggleButton::OnMouse(wxMouseEvent &event)
{
if (!IsEnabled())
return;
wxSize size = GetSize();
bool mouse_in = ((event.GetX() > 0) && (event.GetX() < size.x) &&
(event.GetY() > 0) && (event.GetY() < size.y));
if (m_capturing)
{
bool old_depressed = m_depressed;
if (mouse_in)
m_depressed = !m_oldValue;
else
m_depressed = m_oldValue;
if (event.LeftUp())
{
ReleaseMouse();
m_capturing = false;
if (mouse_in)
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
event.SetEventObject(this);
ProcessCommand(event);
}
}
if (old_depressed != m_depressed)
Refresh();
}
else
{
if (event.LeftDown())
{
m_capturing = true;
m_oldValue = m_depressed;
m_depressed = !m_oldValue;
CaptureMouse();
Refresh();
}
}
}
void wxBitmapToggleButton::OnChar(wxKeyEvent &event)
{
if (event.GetKeyCode() == WXK_SPACE)
{
m_depressed = !m_depressed;
Refresh();
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
event.SetEventObject(this);
ProcessCommand(event);
}
}
void wxBitmapToggleButton::OnSize(wxSizeEvent &WXUNUSED(event))
{
Refresh();
}
wxSize wxBitmapToggleButton::DoGetBestSize() const
{
if (!m_bitmap.IsOk())
return wxSize(16,16);
wxSize ret = m_bitmap.GetSize();
ret.x += 8;
ret.y += 8;
return ret;
}
// ----------------------------------------------------------------------------
// wxToggleButton
@ -251,6 +86,11 @@ wxSize wxBitmapToggleButton::DoGetBestSize() const
IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl)
void wxToggleButton::Init()
{
m_state = false;
}
// Single check box item
bool wxToggleButton::Create(wxWindow *parent,
wxWindowID id,
@ -260,6 +100,8 @@ bool wxToggleButton::Create(wxWindow *parent,
const wxValidator& validator,
const wxString& name)
{
Init();
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;
@ -294,26 +136,29 @@ WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const
return msStyle;
}
wxSize wxToggleButton::DoGetBestSize() const
{
return wxMSWButton::ComputeBestSize(const_cast<wxToggleButton *>(this));
}
void wxToggleButton::SetLabel(const wxString& label)
{
wxMSWButton::UpdateMultilineStyle(GetHwnd(), label);
wxToggleButtonBase::SetLabel(label);
}
void wxToggleButton::SetValue(bool val)
{
::SendMessage(GetHwnd(), BM_SETCHECK, val, 0);
m_state = val;
if ( IsOwnerDrawn() )
{
Refresh();
}
else
{
::SendMessage(GetHwnd(), BM_SETCHECK, val, 0);
}
}
bool wxToggleButton::GetValue() const
{
return ::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED;
if ( IsOwnerDrawn() )
{
return m_state;
}
else
{
return ::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED;
}
}
void wxToggleButton::Command(wxCommandEvent& event)
@ -322,8 +167,18 @@ void wxToggleButton::Command(wxCommandEvent& event)
ProcessCommand(event);
}
bool wxToggleButton::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
bool wxToggleButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
if ( param != BN_CLICKED && param != BN_DBLCLK )
return false;
// first update the value so that user event handler gets the new
// toggle button value
// ownerdrawn buttons don't manage their state themselves unlike usual
// auto checkboxes so do it ourselves in any case
m_state = !m_state;
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
event.SetEventObject(this);
@ -331,4 +186,12 @@ bool wxToggleButton::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
return true;
}
wxAnyButton::State wxToggleButton::GetNormalState() const
{
if ( GetValue() )
return State_Pressed;
else
return State_Normal;
}
#endif // wxUSE_TOGGLEBTN

95
src/osx/anybutton_osx.cpp Normal file
View File

@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/osx/anybutton_osx.cpp
// Purpose: wxAnyButton
// Author: Stefan Csomor
// Created: 1998-01-01 (extracted from button_osx.cpp)
// RCS-ID: $Id: anybutton_osx.cpp 67280 2011-03-22 14:17:38Z DS $
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#include "wx/anybutton.h"
#ifndef WX_PRECOMP
#include "wx/panel.h"
#include "wx/toplevel.h"
#include "wx/dcclient.h"
#include "wx/stattext.h"
#endif
#include "wx/stockitem.h"
#include "wx/osx/private.h"
BEGIN_EVENT_TABLE(wxAnyButton, wxControl)
EVT_ENTER_WINDOW(wxAnyButton::OnEnterWindow)
EVT_LEAVE_WINDOW(wxAnyButton::OnLeaveWindow)
END_EVENT_TABLE()
void wxAnyButton::SetLabel(const wxString& label)
{
if ( HasFlag(wxBU_NOTEXT) )
{
// just store the label internally but don't really use it for the
// button
m_labelOrig =
m_label = label;
return;
}
wxAnyButtonBase::SetLabel(label);
}
wxBitmap wxAnyButton::DoGetBitmap(State which) const
{
return m_bitmaps[which];
}
void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which)
{
m_bitmaps[which] = bitmap;
if ( which == State_Normal )
GetPeer()->SetBitmap(bitmap);
else if ( which == State_Pressed )
{
wxButtonImpl* bi = dynamic_cast<wxButtonImpl*> (GetPeer());
if ( bi )
bi->SetPressedBitmap(bitmap);
}
InvalidateBestSize();
}
void wxAnyButton::DoSetBitmapPosition(wxDirection dir)
{
GetPeer()->SetBitmapPosition(dir);
InvalidateBestSize();
}
#if wxUSE_MARKUP && wxOSX_USE_COCOA
bool wxAnyButton::DoSetLabelMarkup(const wxString& markup)
{
if ( !wxAnyButtonBase::DoSetLabelMarkup(markup) )
return false;
GetPeer()->SetLabelMarkup(markup);
return true;
}
#endif // wxUSE_MARKUP && wxOSX_USE_COCOA
void wxAnyButton::OnEnterWindow( wxMouseEvent& WXUNUSED(event))
{
if ( DoGetBitmap( State_Current ).IsOk() )
GetPeer()->SetBitmap( DoGetBitmap( State_Current ) );
}
void wxAnyButton::OnLeaveWindow( wxMouseEvent& WXUNUSED(event))
{
if ( DoGetBitmap( State_Current ).IsOk() )
GetPeer()->SetBitmap( DoGetBitmap( State_Normal ) );
}

View File

@ -42,11 +42,6 @@ bool IsHelpButtonWithStandardLabel(wxWindowID id, const wxString& label)
} // anonymous namespace
BEGIN_EVENT_TABLE(wxButton, wxControl)
EVT_ENTER_WINDOW(wxButton::OnEnterWindow)
EVT_LEAVE_WINDOW(wxButton::OnLeaveWindow)
END_EVENT_TABLE()
bool wxButton::Create(wxWindow *parent,
wxWindowID id,
const wxString& labelOrig,
@ -105,58 +100,9 @@ void wxButton::SetLabel(const wxString& label)
return;
}
if ( HasFlag(wxBU_NOTEXT) )
{
// just store the label internally but don't really use it for the
// button
m_labelOrig =
m_label = label;
return;
}
wxButtonBase::SetLabel(label);
wxAnyButton::SetLabel(label);
}
wxBitmap wxButton::DoGetBitmap(State which) const
{
return m_bitmaps[which];
}
void wxButton::DoSetBitmap(const wxBitmap& bitmap, State which)
{
m_bitmaps[which] = bitmap;
if ( which == State_Normal )
GetPeer()->SetBitmap(bitmap);
else if ( which == State_Pressed )
{
wxButtonImpl* bi = dynamic_cast<wxButtonImpl*> (GetPeer());
if ( bi )
bi->SetPressedBitmap(bitmap);
}
InvalidateBestSize();
}
void wxButton::DoSetBitmapPosition(wxDirection dir)
{
GetPeer()->SetBitmapPosition(dir);
InvalidateBestSize();
}
#if wxUSE_MARKUP && wxOSX_USE_COCOA
bool wxButton::DoSetLabelMarkup(const wxString& markup)
{
if ( !wxButtonBase::DoSetLabelMarkup(markup) )
return false;
GetPeer()->SetLabelMarkup(markup);
return true;
}
#endif // wxUSE_MARKUP && wxOSX_USE_COCOA
wxWindow *wxButton::SetDefault()
{
wxWindow *btnOldDefault = wxButtonBase::SetDefault();
@ -177,18 +123,6 @@ void wxButton::Command (wxCommandEvent & WXUNUSED(event))
// ProcessCommand(event);
}
void wxButton::OnEnterWindow( wxMouseEvent& WXUNUSED(event))
{
if ( DoGetBitmap( State_Current ).IsOk() )
GetPeer()->SetBitmap( DoGetBitmap( State_Current ) );
}
void wxButton::OnLeaveWindow( wxMouseEvent& WXUNUSED(event))
{
if ( DoGetBitmap( State_Current ).IsOk() )
GetPeer()->SetBitmap( DoGetBitmap( State_Normal ) );
}
bool wxButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId);

View File

@ -0,0 +1,113 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/osx/carbon/anybutton.cpp
// Purpose: wxAnyButton
// Author: Stefan Csomor
// Created: 1998-01-01 (extracted from button.cpp)
// RCS-ID: $Id: anybutton.cpp 67230 2011-03-18 14:20:12Z SC $
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#include "wx/anybutton.h"
#ifndef WX_PRECOMP
#include "wx/panel.h"
#include "wx/toplevel.h"
#include "wx/dcclient.h"
#endif
#include "wx/stockitem.h"
#include "wx/osx/private.h"
wxSize wxAnyButton::DoGetBestSize() const
{
if ( GetId() == wxID_HELP )
return wxSize( 20 , 20 ) ;
wxSize sz = GetDefaultSize() ;
switch (GetWindowVariant())
{
case wxWINDOW_VARIANT_NORMAL:
case wxWINDOW_VARIANT_LARGE:
sz.y = 20 ;
break;
case wxWINDOW_VARIANT_SMALL:
sz.y = 17 ;
break;
case wxWINDOW_VARIANT_MINI:
sz.y = 15 ;
break;
default:
break;
}
#if wxOSX_USE_CARBON
Rect bestsize = { 0 , 0 , 0 , 0 } ;
GetPeer()->GetBestRect( &bestsize ) ;
int wBtn;
if ( EmptyRect( &bestsize ) || ( GetWindowStyle() & wxBU_EXACTFIT) )
{
Point bounds;
ControlFontStyleRec controlFont;
OSStatus err = GetPeer()->GetData<ControlFontStyleRec>( kControlEntireControl, kControlFontStyleTag, &controlFont );
verify_noerr( err );
// GetThemeTextDimensions will cache strings and the documentation
// says not to use the NoCopy string creation calls.
// This also means that we can't use CFSTR without
// -fno-constant-cfstrings if the library might be unloaded,
// as GetThemeTextDimensions may cache a pointer to our
// unloaded segment.
wxCFStringRef str( !m_label.empty() ? m_label : wxString(" "),
GetFont().GetEncoding() );
#if wxOSX_USE_ATSU_TEXT
SInt16 baseline;
if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont )
{
err = GetThemeTextDimensions(
(CFStringRef)str,
m_font.MacGetThemeFontID(), kThemeStateActive, false, &bounds, &baseline );
verify_noerr( err );
}
else
#endif
{
wxClientDC dc(const_cast<wxAnyButton*>(this));
wxCoord width, height ;
dc.GetTextExtent( m_label , &width, &height);
bounds.h = width;
bounds.v = height;
}
wBtn = bounds.h + sz.y;
}
else
{
wBtn = bestsize.right - bestsize.left ;
// non 'normal' window variants don't return the correct height
// sz.y = bestsize.bottom - bestsize.top ;
}
if ((wBtn > sz.x) || ( GetWindowStyle() & wxBU_EXACTFIT))
sz.x = wBtn;
#endif
return sz ;
}
wxSize wxAnyButton::GetDefaultSize()
{
int wBtn = 70 ;
int hBtn = 20 ;
return wxSize(wBtn, hBtn);
}

View File

@ -27,96 +27,6 @@
//
//
wxSize wxButton::DoGetBestSize() const
{
if ( GetId() == wxID_HELP )
return wxSize( 20 , 20 ) ;
wxSize sz = GetDefaultSize() ;
switch (GetWindowVariant())
{
case wxWINDOW_VARIANT_NORMAL:
case wxWINDOW_VARIANT_LARGE:
sz.y = 20 ;
break;
case wxWINDOW_VARIANT_SMALL:
sz.y = 17 ;
break;
case wxWINDOW_VARIANT_MINI:
sz.y = 15 ;
break;
default:
break;
}
#if wxOSX_USE_CARBON
Rect bestsize = { 0 , 0 , 0 , 0 } ;
GetPeer()->GetBestRect( &bestsize ) ;
int wBtn;
if ( EmptyRect( &bestsize ) || ( GetWindowStyle() & wxBU_EXACTFIT) )
{
Point bounds;
ControlFontStyleRec controlFont;
OSStatus err = GetPeer()->GetData<ControlFontStyleRec>( kControlEntireControl, kControlFontStyleTag, &controlFont );
verify_noerr( err );
// GetThemeTextDimensions will cache strings and the documentation
// says not to use the NoCopy string creation calls.
// This also means that we can't use CFSTR without
// -fno-constant-cfstrings if the library might be unloaded,
// as GetThemeTextDimensions may cache a pointer to our
// unloaded segment.
wxCFStringRef str( !m_label.empty() ? m_label : wxString(" "),
GetFont().GetEncoding() );
#if wxOSX_USE_ATSU_TEXT
SInt16 baseline;
if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont )
{
err = GetThemeTextDimensions(
(CFStringRef)str,
m_font.MacGetThemeFontID(), kThemeStateActive, false, &bounds, &baseline );
verify_noerr( err );
}
else
#endif
{
wxClientDC dc(const_cast<wxButton*>(this));
wxCoord width, height ;
dc.GetTextExtent( m_label , &width, &height);
bounds.h = width;
bounds.v = height;
}
wBtn = bounds.h + sz.y;
}
else
{
wBtn = bestsize.right - bestsize.left ;
// non 'normal' window variants don't return the correct height
// sz.y = bestsize.bottom - bestsize.top ;
}
if ((wBtn > sz.x) || ( GetWindowStyle() & wxBU_EXACTFIT))
sz.x = wBtn;
#endif
return sz ;
}
wxSize wxButton::GetDefaultSize()
{
int wBtn = 70 ;
int hBtn = 20 ;
return wxSize(wBtn, hBtn);
}
wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
wxWindowMac* parent,
wxWindowID id,

View File

@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/osx/cocoa/anybutton.mm
// Purpose: wxAnyButton
// Author: Stefan Csomor
// Created: 1998-01-01 (extracted from button.mm)
// RCS-ID: $Id: anybutton.mm 67681 2011-05-03 16:29:04Z DS $
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#include "wx/button.h"
#ifndef WX_PRECOMP
#endif
#include "wx/osx/private.h"
wxSize wxAnyButton::DoGetBestSize() const
{
// We only use help button bezel if we don't have any (non standard) label
// to display in the button. Otherwise even wxID_HELP buttons look like
// normal push buttons.
if ( GetId() == wxID_HELP && GetLabel().empty() )
return wxSize( 23 , 23 ) ;
wxRect r ;
GetPeer()->GetBestRect(&r);
wxSize sz = r.GetSize();
sz.x = sz.x + MacGetLeftBorderSize() +
MacGetRightBorderSize();
sz.y = sz.y + MacGetTopBorderSize() +
MacGetBottomBorderSize();
const int wBtnStd = GetDefaultSize().x;
if ( (sz.x < wBtnStd) && !HasFlag(wxBU_EXACTFIT) )
sz.x = wBtnStd;
return sz ;
}
wxSize wxAnyButton::GetDefaultSize()
{
return wxSize(84, 20);
}

View File

@ -23,36 +23,6 @@
#endif // wxUSE_MARKUP
wxSize wxButton::DoGetBestSize() const
{
// We only use help button bezel if we don't have any (non standard) label
// to display in the button. Otherwise even wxID_HELP buttons look like
// normal push buttons.
if ( GetId() == wxID_HELP && GetLabel().empty() )
return wxSize( 23 , 23 ) ;
wxRect r ;
GetPeer()->GetBestRect(&r);
wxSize sz = r.GetSize();
sz.x = sz.x + MacGetLeftBorderSize() +
MacGetRightBorderSize();
sz.y = sz.y + MacGetTopBorderSize() +
MacGetBottomBorderSize();
const int wBtnStd = GetDefaultSize().x;
if ( (sz.x < wBtnStd) && !HasFlag(wxBU_EXACTFIT) )
sz.x = wBtnStd;
return sz ;
}
wxSize wxButton::GetDefaultSize()
{
return wxSize(84, 20);
}
@implementation wxNSButton
+ (void)initialize

View File

@ -0,0 +1,56 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/osx/iphone/anybutton.mm
// Purpose: wxAnyButton
// Author: Stefan Csomor
// Created: 1998-01-01 (extracted from button.mm)
// RCS-ID: $Id: anybutton.mm 67232 2011-03-18 15:10:15Z DS $
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#include "wx/anybutton.h"
#ifndef WX_PRECOMP
#include "wx/panel.h"
#include "wx/toplevel.h"
#include "wx/dcclient.h"
#endif
#include "wx/stockitem.h"
#include "wx/osx/private.h"
wxSize wxAnyButton::DoGetBestSize() const
{
if ( GetId() == wxID_HELP )
return wxSize( 18 , 18 ) ;
wxSize sz = GetDefaultSize() ;
wxRect r ;
GetPeer()->GetBestRect(&r);
if ( r.GetWidth() == 0 && r.GetHeight() == 0 )
{
}
sz.x = r.GetWidth();
sz.y = r.GetHeight();
int wBtn = 72;
if ((wBtn > sz.x) || ( GetWindowStyle() & wxBU_EXACTFIT))
sz.x = wBtn;
return sz ;
}
wxSize wxAnyButton::GetDefaultSize()
{
int wBtn = 72 ;
int hBtn = 35 ;
return wxSize(wBtn, hBtn);
}

View File

@ -23,39 +23,6 @@
#include "wx/osx/private.h"
wxSize wxButton::DoGetBestSize() const
{
if ( GetId() == wxID_HELP )
return wxSize( 18 , 18 ) ;
wxSize sz = GetDefaultSize() ;
wxRect r ;
GetPeer()->GetBestRect(&r);
if ( r.GetWidth() == 0 && r.GetHeight() == 0 )
{
}
sz.x = r.GetWidth();
sz.y = r.GetHeight();
int wBtn = 72;
if ((wBtn > sz.x) || ( GetWindowStyle() & wxBU_EXACTFIT))
sz.x = wBtn;
return sz ;
}
wxSize wxButton::GetDefaultSize()
{
int wBtn = 72 ;
int hBtn = 35 ;
return wxSize(wBtn, hBtn);
}
@implementation wxUIButton
+ (void)initialize

View File

@ -49,6 +49,21 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
{
DontCreatePeer();
m_marginX =
m_marginY = 0;
// FIXME: this hack is needed because we're called from
// wxBitmapToggleButton::Create() with this style and we currently use a
// different wxWidgetImpl method (CreateBitmapToggleButton() rather than
// CreateToggleButton()) for creating bitmap buttons, but we really ought
// to unify the creation of buttons of all kinds and then remove
// this check
if ( style & wxBU_NOTEXT )
{
return wxControl::Create(parent, id, pos, size, style,
validator, name);
}
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
@ -102,7 +117,7 @@ bool wxToggleButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
// wxBitmapToggleButton
// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButton)
bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id,
const wxBitmap& label,
@ -113,13 +128,13 @@ bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id,
{
DontCreatePeer();
m_bitmap = label;
if ( !wxToggleButton::Create(parent, id, wxEmptyString, pos, size, style | wxBU_NOTEXT | wxBU_EXACTFIT, validator, name) )
return false;
m_marginX =
m_marginY = wxDEFAULT_BUTTON_MARGIN;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
m_bitmaps[State_Normal] = label;
SetPeer(wxWidgetImpl::CreateBitmapToggleButton( this, parent, id, label, pos, size, style, GetExtraStyle() ));
@ -130,40 +145,15 @@ bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id,
wxSize wxBitmapToggleButton::DoGetBestSize() const
{
if (!m_bitmap.IsOk())
if (!GetBitmap().IsOk())
return wxSize(20,20);
wxSize best;
best.x = m_bitmap.GetWidth() + 2 * m_marginX;
best.y = m_bitmap.GetHeight() + 2 * m_marginY;
best.x = GetBitmap().GetWidth() + 2 * m_marginX;
best.y = GetBitmap().GetHeight() + 2 * m_marginY;
return best;
}
void wxBitmapToggleButton::SetValue(bool val)
{
GetPeer()->SetValue( val ) ;
}
bool wxBitmapToggleButton::GetValue() const
{
return GetPeer()->GetValue() ;
}
void wxBitmapToggleButton::Command(wxCommandEvent & event)
{
SetValue((event.GetInt() != 0));
ProcessCommand(event);
}
bool wxBitmapToggleButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
event.SetEventObject(this);
ProcessCommand(event);
return noErr ;
}
#endif // wxUSE_TOGGLEBTN