diff options
author | Dan Gudmundsson <[email protected]> | 2011-06-27 12:59:00 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2011-09-21 12:46:14 +0200 |
commit | 7359eb8c81adb6331be7df963e08ab7dd6ccbe0e (patch) | |
tree | d7c526c45f1d29caf9990d690df77e8b665e21c2 /lib/wx/test/wx_class_SUITE.erl | |
parent | 51b66111af55e26710d5e8e0a8c3f98c38bd7207 (diff) | |
download | otp-7359eb8c81adb6331be7df963e08ab7dd6ccbe0e.tar.gz otp-7359eb8c81adb6331be7df963e08ab7dd6ccbe0e.tar.bz2 otp-7359eb8c81adb6331be7df963e08ab7dd6ccbe0e.zip |
[wx] Test colors in textctrl
Diffstat (limited to 'lib/wx/test/wx_class_SUITE.erl')
-rw-r--r-- | lib/wx/test/wx_class_SUITE.erl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index 00ef1289ab..b75b0cc74e 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -448,3 +448,25 @@ systemSettings(Config) -> wxWindow:show(Frame), wx_test_lib:wx_destroy(Frame,Config). + + +textCtrl(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); +textCtrl(Config) -> + Wx = wx:new(), + Frame = wxFrame:new(Wx, ?wxID_ANY, "Frame"), + + TC = ?mt(wxTextCtrl, wxTextCtrl:new(Frame, ?wxID_ANY, [{style, ?wxTE_MULTILINE bor ?wxTE_RICH2}])), + wxTextCtrl:appendText(TC, "This line is in default color\n"), + Attr = ?mt(wxTextAttr, wxTextAttr:new(?wxRED)), + wxTextCtrl:setDefaultStyle(TC, Attr), + wxTextCtrl:appendText(TC, "This line is in ?wxRED color\n"), + wxTextAttr:setTextColour(Attr, ?wxBLACK), + wxTextCtrl:setDefaultStyle(TC, Attr), + wxTextCtrl:appendText(TC, "This line is in ?wxBLACK color\n"), + Default = wxSystemSettings:getColour(?wxSYS_COLOUR_WINDOWTEXT), + wxTextAttr:setTextColour(Attr, Default), + wxTextCtrl:setDefaultStyle(TC, Attr), + wxTextCtrl:appendText(TC, "This line is in default color\n"), + wxTextAttr:destroy(Attr), + wxWindow:show(Frame), + wx_test_lib:wx_destroy(Frame,Config). |