Bug #57 black on black = hard to use

This commit is contained in:
Zane U. Ji 2014-05-21 21:35:24 +08:00
parent 2adc7a133a
commit b177e06392
4 changed files with 28 additions and 7 deletions

View File

@ -3,6 +3,7 @@
+ Feature #155 XPath - functions + Feature #155 XPath - functions
+ Click on the error message to jump to the error location + Click on the error message to jump to the error location
* Bug #99 fix desktop file (Marco Rodrigues) * Bug #99 fix desktop file (Marco Rodrigues)
* Bug #57 black on black = hard to use
1.2.1.1 2014/05/04 1.2.1.1 2014/05/04
+ Feature #25 Fast commenting + Feature #25 Fast commenting

View File

@ -21,6 +21,7 @@
#include "xmldoc.h" #include "xmldoc.h"
BEGIN_EVENT_TABLE ( LocationPanel, wxPanel ) BEGIN_EVENT_TABLE ( LocationPanel, wxPanel )
EVT_SYS_COLOUR_CHANGED ( LocationPanel::OnSysColourChanged )
END_EVENT_TABLE() END_EVENT_TABLE()
LocationPanel::LocationPanel ( wxWindow *parentWindowParameter, int id ) : LocationPanel::LocationPanel ( wxWindow *parentWindowParameter, int id ) :
@ -59,6 +60,10 @@ LocationPanel::LocationPanel ( wxWindow *parentWindowParameter, int id ) :
//structureEdit->SetWrapVisualFlags ( wxSTC_WRAPVISUALFLAG_START ); //structureEdit->SetWrapVisualFlags ( wxSTC_WRAPVISUALFLAG_START );
structureEdit->SetTabWidth ( 2 ); structureEdit->SetTabWidth ( 2 );
structureEdit->SetIndentationGuides ( true ); structureEdit->SetIndentationGuides ( true );
structureEdit->SetLexer ( wxSTC_LEX_NULL );
wxSysColourChangedEvent event;
OnSysColourChanged ( event );
sizer->Add ( edit, 0, wxGROW | wxTOP, 0 ); sizer->Add ( edit, 0, wxGROW | wxTOP, 0 );
sizer->Add ( structureEdit, 1, wxGROW | wxTOP, 0 ); sizer->Add ( structureEdit, 1, wxGROW | wxTOP, 0 );
@ -169,3 +174,12 @@ void LocationPanel::indentStructure ( wxString& structure )
} }
structure = indented; structure = indented;
} }
void LocationPanel::OnSysColourChanged ( wxSysColourChangedEvent &WXUNUSED ( event ) )
{
wxColor clrWnd = wxSystemSettings::GetColour ( wxSYS_COLOUR_WINDOW );
wxColor clrText = wxSystemSettings::GetColour ( wxSYS_COLOUR_WINDOWTEXT );
structureEdit->StyleSetForeground ( wxSTC_STYLE_DEFAULT, clrText );
structureEdit->StyleSetBackground ( wxSTC_STYLE_DEFAULT, clrWnd );
structureEdit->StyleClearAll();
}

View File

@ -33,6 +33,7 @@ class LocationPanel : public wxPanel
void update ( void update (
XmlDoc *docParameter = NULL, XmlDoc *docParameter = NULL,
const wxString& parent = wxEmptyString ); const wxString& parent = wxEmptyString );
void OnSysColourChanged ( wxSysColourChangedEvent &event );
private: private:
void indentStructure ( wxString& structure ); void indentStructure ( wxString& structure );
MyFrame *parentWindow; MyFrame *parentWindow;

View File

@ -1209,13 +1209,15 @@ void XmlCtrl::applyProperties (
SetMarginWidth ( 2, 16 ); SetMarginWidth ( 2, 16 );
// define folding markers // define folding markers
MarkerDefine ( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, *wxWHITE, *wxBLACK ); wxColor clrWnd = wxSystemSettings::GetColour ( wxSYS_COLOUR_WINDOW );
MarkerDefine ( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, *wxWHITE, *wxBLACK ); wxColor clrText = wxSystemSettings::GetColour ( wxSYS_COLOUR_WINDOWTEXT );
MarkerDefine ( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, *wxWHITE, *wxBLACK ); MarkerDefine ( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, clrWnd, clrText );
MarkerDefine ( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, *wxWHITE, *wxBLACK ); MarkerDefine ( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, clrWnd, clrText );
MarkerDefine ( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, *wxWHITE, *wxBLACK ); MarkerDefine ( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, clrWnd, clrText );
MarkerDefine ( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, *wxWHITE, *wxBLACK ); MarkerDefine ( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, clrWnd, clrText );
MarkerDefine ( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, *wxWHITE, *wxBLACK ); MarkerDefine ( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, clrWnd, clrText );
MarkerDefine ( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, clrWnd, clrText );
MarkerDefine ( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, clrWnd, clrText );
} }
else else
{ {
@ -1741,6 +1743,9 @@ void XmlCtrl::setColorScheme ( int scheme )
StyleSetBold ( wxSTC_H_SGML_DEFAULT, true ); StyleSetBold ( wxSTC_H_SGML_DEFAULT, true );
} }
wxColour color = wxSystemSettings::GetColour ( wxSYS_COLOUR_WINDOWTEXT );
StyleSetForeground ( wxSTC_STYLE_LINENUMBER, color );
applyVisibilityState ( visibilityState ); applyVisibilityState ( visibilityState );
} }