wxNotebook problem DrawRotatedText  [SOLVED]

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
palikem
Experienced Solver
Experienced Solver
Posts: 69
Joined: Sat Oct 28, 2017 9:33 am
Location: Slovensko

wxNotebook problem DrawRotatedText

Postby palikem » Sun Dec 03, 2017 1:04 am

Hello

DrawRotatedText is not working in wxNotebook
Is there a solution to this problem?

Code: Select all

   WxNotebook1 = new wxNotebook(this, ID_WXNOTEBOOK1, wxPoint(-6, 30), wxSize(795, 535), wxNB_DEFAULT);
   WxNotebook1->SetForegroundColour(wxColour(0,0,0));
   WxNotebook1->SetBackgroundColour(wxColour(_("WHITE")));
   WxNotebook1->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, _("MS Sans Serif")));

   Measurement = new wxPanel(WxNotebook1, ID_MEASUREMENT, wxPoint(4, 27), wxSize(787, 504));
   Measurement->SetBackgroundColour(wxColour(_("WHITE")));
   Measurement->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, _("MS Sans Serif")));
   WxNotebook1->AddPage(Measurement, _("   Measurement   "));
   
   Calibration = new wxPanel(WxNotebook1, ID_CALIBRATION, wxPoint(4, 27), wxSize(787, 504));
   Calibration->SetBackgroundColour(wxColour(_("WHITE")));
   Calibration->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, _("MS Sans Serif")));
   WxNotebook1->AddPage(Calibration, _("   Calibration   "));


Code: Select all

wxPaintDC dh(Calibration);

dh.SetDeviceOrigin( 0, dh.GetSize().GetHeight()-1 );
dh.SetAxisOrientation(true, true);

dh.DrawRotatedText(" I(45°)", 100, 100, 90.0);


Thank you for the reactions...

User avatar
doublemax
Moderator
Moderator
Posts: 12606
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxNotebook problem DrawRotatedText

Postby doublemax » Sun Dec 03, 2017 8:42 am

I'm pretty sure this has nothing to do with wxNoteBook. In which class is the paint event handler and how do you connect it? (Static event table, Connect() or Bind() )
Use the source, Luke!

palikem
Experienced Solver
Experienced Solver
Posts: 69
Joined: Sat Oct 28, 2017 9:33 am
Location: Slovensko

Re: wxNotebook problem DrawRotatedText

Postby palikem » Sun Dec 03, 2017 8:56 am

Code: Select all

BEGIN_EVENT_TABLE(AdcFrm,wxFrame)
   
   EVT_CLOSE(AdcFrm::OnClose)
   EVT_SIZE(AdcFrm::AdcFrmSize)
   EVT_PAINT(AdcFrm::AdcFrmPaint)
   EVT_MOUSE_EVENTS(AdcFrm::AdcFrmMouseEvents)
   EVT_TIMER(ID_TIME,AdcFrm::TimeTimer)
   
   EVT_GRID_CELL_CHANGE(AdcFrm::TabulkaCellChange)
   
   EVT_TEXT(ID_SAMPLE,AdcFrm::DurationUpdated)
   
   EVT_TEXT(ID_DURATION,AdcFrm::DurationUpdated)
   
   EVT_TEXT(ID_PERCENTA,AdcFrm::PercentaUpdated)
   EVT_BUTTON(ID_START,AdcFrm::StartClick)
   EVT_BUTTON(ID_STOP,AdcFrm::StopClick0)
   
   EVT_NOTEBOOK_PAGE_CHANGED(ID_WXNOTEBOOK1,AdcFrm::WxNotebook1PageChanged)
END_EVENT_TABLE()

palikem
Experienced Solver
Experienced Solver
Posts: 69
Joined: Sat Oct 28, 2017 9:33 am
Location: Slovensko

Re: wxNotebook problem DrawRotatedText

Postby palikem » Sun Dec 03, 2017 9:43 am

you were right doublemax

I tried it in another program
And there it goes
Now I do not know where the error will be :oops:

frame.jpg
frame.jpg (27.14 KiB) Viewed 606 times

palikem
Experienced Solver
Experienced Solver
Posts: 69
Joined: Sat Oct 28, 2017 9:33 am
Location: Slovensko

Re: wxNotebook problem DrawRotatedText  [SOLVED]

Postby palikem » Sun Dec 03, 2017 11:12 am

Problem solved
The problem was wxFont

Code: Select all

dh.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, _("MS Sans Serif")));


Return to “wxDev-C++”

Who is online

Users browsing this forum: No registered users and 1 guest