Search found 13 matches

by devhobby
Fri Jun 12, 2020 1:44 pm
Forum: C++ Development
Topic: The program clears my clipboard on shutdown!
Replies: 5
Views: 179

Re: The program clears my clipboard on shutdown!

That solved the problem, thank you very much! :D
by devhobby
Fri Jun 12, 2020 12:42 pm
Forum: C++ Development
Topic: The program clears my clipboard on shutdown!
Replies: 5
Views: 179

Re: The program clears my clipboard on shutdown!

What is your wx version and under which platform you tst the application? Can you reproduce this with the stc sample from the wxWidgets and/or with the native SciTe sample program? I'm on Windows 10, using wxWidgets version 3.1.2 Try wxClipboard::Flush I tried with wxTheClipboard->Flush(); in the w...
by devhobby
Fri Jun 12, 2020 12:44 am
Forum: C++ Development
Topic: The program clears my clipboard on shutdown!
Replies: 5
Views: 179

The program clears my clipboard on shutdown!

This is weird. When I copy something written in the wxStyledTextCtrl and paste it somewhere else, everything is fine... but when I close the application, what I just copied from the wxStyledTextCtrl gets cleared from the clipboard! This does not happen if I copy something from somewhere else... even...
by devhobby
Wed Aug 21, 2019 7:29 pm
Forum: C++ Development
Topic: Customize X (close) button behaviour
Replies: 1
Views: 154

Customize X (close) button behaviour

Hi. I have a function, say, MyExit() which internally calls Close(true) after doing some checks here and there. Now I want these checks to be done when the user presses the X (close window) button as well. So I would like to link the close window event to the function MyExit() which then calls Close...
by devhobby
Thu Jul 04, 2019 5:53 pm
Forum: C++ Development
Topic: Detect any change in TextCtrl/StyledTextCtrl
Replies: 2
Views: 188

Re: Detect any change in TextCtrl/StyledTextCtrl

In the documentation for the wxWidgets controls you'll usually find a list of events that this control emits near the top. Unfortunately the events for wxStyledTextCtrl are not properly documented, but wxEVT_STC_CHANGE should be the one you're looking for. https://docs.wxwidgets.org/trunk/classwx_s...
by devhobby
Thu Jul 04, 2019 5:21 pm
Forum: C++ Development
Topic: Detect any change in TextCtrl/StyledTextCtrl
Replies: 2
Views: 188

Detect any change in TextCtrl/StyledTextCtrl

Hi.

As the title says, I would like to know how to detect any change in my (Styled)TextCtrl.

I don't care which specific button was pressed, I just need to know when the user actually types something

Thanks in advance!
by devhobby
Wed Jul 03, 2019 7:39 pm
Forum: C++ Development
Topic: Monospace font in TextCtrl?
Replies: 15
Views: 860

Re: Monospace font in TextCtrl?

Thank you guys to every single one of you [-o<

I don't even know which answer to accept, you've all been great 8-[
by devhobby
Wed Jul 03, 2019 6:49 pm
Forum: C++ Development
Topic: Monospace font in TextCtrl?
Replies: 15
Views: 860

Re: Monospace font in TextCtrl?

Just curious: why do you need tabs? I need the TAB width to be smaller, like in IDEs and editors. wxStyledTextCtrl is mainly the code editor, where the styles are used (not only) for syntax coloring of programming languages, see e.g. here https://github.com/NewPagodi/wxSTCmee/blob/master/doc/DocPar...
by devhobby
Wed Jul 03, 2019 6:29 pm
Forum: C++ Development
Topic: Monospace font in TextCtrl?
Replies: 15
Views: 860

Re: Monospace font in TextCtrl?

With wxSTC you have to apply styles. First Apply TextColor, Background color, font et al using special wxSTC way. Here is an example to whole editor Hi and thank you! It works perfectly but the obvious question arises: a for loop to apply my font to every style? I mean... how many styles can a Text...
by devhobby
Tue Jul 02, 2019 8:09 pm
Forum: C++ Development
Topic: Monospace font in TextCtrl?
Replies: 15
Views: 860

Re: Monospace font in TextCtrl?

wxSTC lives in its own library. The exact name depends on your compiler / build configuration, but it ends with "_stc", e.g. "wxmsw31u_stc.lib". Find it and add it to the linker input files. Oh thank you very much for that! --- So now that I've switched from TextCtrl to StyledTextCtrl, assigning a ...
by devhobby
Tue Jul 02, 2019 7:48 pm
Forum: C++ Development
Topic: Monospace font in TextCtrl?
Replies: 15
Views: 860

Re: Monospace font in TextCtrl?

You should definitely look into wxStyledTextCtrl, i think it's better suited to build an editor. Unfortunately its documentation is quite bad. I tried to add a wxStyledTextCtrl to my Window as you suggested stextbox = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTE_MULTI...
by devhobby
Tue Jul 02, 2019 4:16 pm
Forum: C++ Development
Topic: Monospace font in TextCtrl?
Replies: 15
Views: 860

Re: Monospace font in TextCtrl?

Create a wxFont with wxFONTFAMILY_TELETYPE family (see the appropriate constructor). Then use it with SetFont() for your text control. Thank you very vey much! Do you, by any chance, also know how to reduce the Tab width? It's way too large at the moment. I found out there is the SetTabs() function...
by devhobby
Tue Jul 02, 2019 1:30 pm
Forum: C++ Development
Topic: Monospace font in TextCtrl?
Replies: 15
Views: 860

Monospace font in TextCtrl?

Hi. I'm trying to understand how to use a monospace font in TextCtrl... i'm building an editor and it's important that every character occupies the same space. All I've found is wxFont::IsFixedWidth() which tells me whether the font is monospaced or not, buy how do I set it to be ? Thanks in advance!