Search found 307 matches

by New Pagodi
Sun Jun 03, 2018 12:57 am
Forum: C++ Development
Topic: wxstyledtextctrl (Scintilla) - How to change style of a specific line
Replies: 4
Views: 507

Re: wxstyledtextctrl (Scintilla) - How to change style of a specific line

The best way to do what you want to do is with indicators. Assuming you have your text control is named m_stc, you would set an indicator for an entire line like this: int errorIndicNo = 8; //or any number between 8 and 32 m_stc->IndicatorSetStyle(errorIndicNo ,wxSTC_INDIC_SQUIGGLE); //or whatever s...
by New Pagodi
Fri May 25, 2018 7:38 pm
Forum: C++ Development
Topic: Mirrored Text
Replies: 6
Views: 516

Re: Mirrored Text

You can use the Rotate method to add a rotation factor to the matrix . Just remember that when dealing with matrices, the order of operation matters. For example, this code: mat.Translate(50, 50); mat.Mirror(wxVERTICAL); mat.Rotate(45*3.14/180); dc.SetTransformMatrix(mat); dc.DrawText("Hello",0,0); ...
by New Pagodi
Thu May 24, 2018 8:14 pm
Forum: C++ Development
Topic: Mirrored Text
Replies: 6
Views: 516

Re: Mirrored Text

In addition to the above, you can use a transformation matrix for the DC itself without wrapping it into a graphics context first. For example to mirror across the line x =50, you could do something like wxAffineMatrix2D mat = dc.GetTransformMatrix(); mat.Translate(50, 0); mat.Mirror(); dc.SetTransf...
by New Pagodi
Thu May 17, 2018 10:21 pm
Forum: Platform Related Issues
Topic: Win32 API GetTopWindow() - how to call it
Replies: 2
Views: 447

Re: Win32 API GetTopWindow() - how to call it

You probably just need to use the scope operator. ie use ::GetTopWindow() to call the global function instead of class method with the same name.
by New Pagodi
Thu May 10, 2018 3:14 pm
Forum: C++ Development
Topic: Strange behaviour in DC
Replies: 27
Views: 1820

Re: Strange behaviour in DC

You need to bind the event handler directly to the control like so: m_staticBitmap->Bind(wxEVT_MOUSE_CAPTURE_LOST, &ImageDialog::OnMouseCaptureLost, this); Replace 'm_staticBitmap' with the name of the control you're actually using. Also, the event type that the event handler will receive is wxMouse...
by New Pagodi
Thu May 10, 2018 2:54 pm
Forum: C++ Development
Topic: Strange behaviour in DC
Replies: 27
Views: 1820

Re: Strange behaviour in DC

EVT_MOUSE_CAPTURE_LOST is not a mouse event. It is generated by the wxWindow class. However, it's a more obscure event, so it is not listed in wxFormbuilder with the other window events. To handle that event, you should use the Connect or Bind methods to add a handler for it in the constructor for ...
by New Pagodi
Sat May 05, 2018 9:22 pm
Forum: C++ Development
Topic: wxDynamicCast doesn't work
Replies: 5
Views: 362

Re: wxDynamicCast doesn't work

I think wxDynamicCast uses the wxWidgets RTTI system. So in order to be able to cast to that class type you have to use the wxDECLARE_DYNAMIC_CLASS/wxIMPLEMENT_DYNAMIC_CLASS or wxDECLARE_ABSTRACT_CLASS/wxIMPLEMENT_ABSTRACT_CLASS macros to make that class type known to the RTTI system. As the docs sa...
by New Pagodi
Wed May 02, 2018 3:59 pm
Forum: C++ Development
Topic: How to See Macro Code
Replies: 8
Views: 519

Re: How to See Macro Code

Correct me if I'm wrong, but it seems to me that wxWidgets is like an extensive "Additional language" of its own, largely defined in these Macros? I don't think so - at least not more so than any other c/c++ library of moderate size. As PB said, if you use the newer Bind method for event handling, ...
by New Pagodi
Wed May 02, 2018 2:37 pm
Forum: C++ Development
Topic: How to See Macro Code
Replies: 8
Views: 519

Re: How to See Macro Code

I guess I misunderstood. The macro definitions used by wxWidgets are going to be distributed over hundreds of files and many of them are going to be buried in multiple #if or #ifdef statements. So I wouldn't go looking for most of them. If you're new to c++ and wxWidgets you should just focus on wha...
by New Pagodi
Wed May 02, 2018 2:02 pm
Forum: C++ Development
Topic: How to See Macro Code
Replies: 8
Views: 519

Re: How to See Macro Code

That depends on your compiler. With gcc, you can use the -E option to run the preprocessor and expand all the macro definitions. With visual c++, you would use the /P switch. I'm sure there is a similar option for clang, but I'm not sure what it is. Just a word of warning though, when you run the pr...
by New Pagodi
Sun Apr 29, 2018 2:40 pm
Forum: Platform Related Issues
Topic: Transparent part of Icons becomes black on ToolBar on Windows
Replies: 4
Views: 720

Re: Transparent part of Icons becomes black on ToolBar on Windows

Like PB said, this appears to be a manifest issue. Try adding an rc file containing at least the line:

Code: Select all

#include "wx/msw/wx.rc"
That will include the standard wxwidgets manifest file in your project.
by New Pagodi
Wed Apr 25, 2018 1:41 pm
Forum: Component Writing
Topic: Bezier curve control
Replies: 2
Views: 788

Re: Bezier curve control

Here's one approach for drawing a dragable curve on a panel. The idea is to keep track of the points in a vector and handle the mouse events for adding or dragging points. // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #en...
by New Pagodi
Wed Apr 25, 2018 6:11 am
Forum: Compiler / Linking / IDE Related
Topic: Unresolved Reference on first Attempt to build
Replies: 5
Views: 2310

Re: Unresolved Reference on first Attempt to build

I just answered a similar question on stack overflow. Here's a screenshot that shows where to add the 2 extra libraries in codeblocks:

Image
by New Pagodi
Sun Apr 22, 2018 6:19 am
Forum: C++ Development
Topic: help drawing this on device context
Replies: 19
Views: 1250

Re: help drawing this on device context

I would expect the points to be an array or vector but I dont think it is. So how do I put multiple values in a wxPoint * You can allocate them with the new operator wxPoint* myArray = new wxPoint[n]; for (size_t i=0;i<n;++i) { myArray[i].x=...; myArray[i].y=...; } wxRegion myRegion(n,myArray); //d...