Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxTextCtrl style changes itself

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxTextCtrl style changes itself
#4439
Posted by: DaRkZeAlOt 2004-06-12 23:19:29
Hi,
I'm using a wxTextCtrl in an app. After the wxTextCtrl code i set the defaultStyle ... :

====================================================================

  textFenster = (wxTextCtrl *) NULL;
  textFenster = new wxTextCtrl
     (
   this,
   -1,
   wxString(""),
     wxDefaultPosition,
     wxDefaultSize,
     wxTE_MULTILINE | wxTE_RICH
     );

  textFenster->SetDefaultStyle(wxTextAttr(*wxBLACK, wxNullColour, wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, _T("Lucida Console"))));   

====================================================================

Its all done in the frame constructor. This textcontrol behaves realy strange :
- when i type text in the window after opening the app its using the right font
- when i don't type text and open a file after starting the app, the control is using the wrong (default) font
-but when i type text and open AFTER that a file is uses the right font again...
- after typing text and clearing the control (with textFenster->clear()) opening a file causes the same like directly trying open a file.

What's the reason for this ? Shouldn't the app fallback to the as DefaultStyle setted style after opening or clearing ?
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2021-4-14  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0