Add font colour support to wxFontPickerCtrl.
Currently this is only really implemented under Windows, just as the colour support in wxFontDialog, but make the API available under all platforms for consistency. Closes #11614. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "wx/filepicker.h"
|
||||
#include "wx/fontpicker.h"
|
||||
#include "pickerbasetest.h"
|
||||
#include "asserthelper.h"
|
||||
|
||||
#if wxUSE_COLOURPICKERCTRL
|
||||
|
||||
@@ -172,8 +173,11 @@ private:
|
||||
|
||||
CPPUNIT_TEST_SUITE( FontPickerCtrlTestCase );
|
||||
wxPICKER_BASE_TESTS();
|
||||
CPPUNIT_TEST( ColourSelection );
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
void ColourSelection();
|
||||
|
||||
wxFontPickerCtrl *m_font;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(FontPickerCtrlTestCase)
|
||||
@@ -198,4 +202,16 @@ void FontPickerCtrlTestCase::tearDown()
|
||||
wxDELETE(m_font);
|
||||
}
|
||||
|
||||
void FontPickerCtrlTestCase::ColourSelection()
|
||||
{
|
||||
wxColour selectedColour(0xFF4269UL);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("Default font picker color must be black",
|
||||
m_font->GetSelectedColour(), wxColour(*wxBLACK));
|
||||
|
||||
m_font->SetSelectedColour(selectedColour);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("Font picker did not react to color selection",
|
||||
m_font->GetSelectedColour(), selectedColour);
|
||||
}
|
||||
#endif //wxUSE_FONTPICKERCTRL
|
||||
|
Reference in New Issue
Block a user