Page 1 of 1

wxNotebook problem DrawRotatedText

Posted: Sun Dec 03, 2017 1:04 am
by palikem
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...

Re: wxNotebook problem DrawRotatedText

Posted: Sun Dec 03, 2017 8:42 am
by doublemax
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() )

Re: wxNotebook problem DrawRotatedText

Posted: Sun Dec 03, 2017 8:56 am
by palikem

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()

Re: wxNotebook problem DrawRotatedText

Posted: Sun Dec 03, 2017 9:43 am
by palikem
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 24513 times

Re: wxNotebook problem DrawRotatedText

Posted: Sun Dec 03, 2017 11:12 am
by palikem
Problem solved
The problem was wxFont

Code: Select all

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