Search found 68 matches

by ValeV
Thu Jun 13, 2019 9:37 am
Forum: C++ Development
Topic: wxStaticLine resizing
Replies: 14
Views: 327

Re: wxStaticLine resizing

>FlexGridSizer1->Add(StaticLine1, 0, wxALL, 5); Line is not visible. >FlexGridSizer1->Add(StaticLine1, 0, wxALL|wxSHAPED, 5); Not visible, on resize it becomes square like in my previous picture, but just on the left side of the window. >FlexGridSizer1->Add(StaticLine1, 0, wxEXPAND|wxALL|wxSHAPED, 5...
by ValeV
Tue Jun 11, 2019 6:14 am
Forum: C++ Development
Topic: wxStaticLine resizing
Replies: 14
Views: 327

Re: wxStaticLine resizing

Full code below. Again, I use wxSmith so I didn't write any of this code manually. BinaryConverterFrame::BinaryConverterFrame(wxWindow* parent,wxWindowID id) { //(*Initialize(BinaryConverterFrame) wxBoxSizer* BoxSizer1; wxFlexGridSizer* FlexGridSizer1; wxMenu* Menu1; wxMenu* Menu2; wxMenuBar* MenuBa...
by ValeV
Mon Jun 10, 2019 12:07 pm
Forum: C++ Development
Topic: wxStaticLine resizing
Replies: 14
Views: 327

Re: wxStaticLine resizing

Yes, but when I resize the window, the horizontal line becomes a square That looks like you set a proportion > 0 when adding it to the sizer. Try 0. If that doesn't fix it, please show the sizer code for that dialog. Properties are the same as on a screenshot from my earlier post. Here is the code:...
by ValeV
Mon Jun 10, 2019 6:25 am
Forum: C++ Development
Topic: wxStaticLine resizing
Replies: 14
Views: 327

Re: wxStaticLine resizing

I'm mildly confused. On the screenshot i only see a horizontal line. And FWIW, as the two gui parts are already enclosed in a wxStaticBox, IMHO they don't need an additional visual separation. At most i would put a spacer with a fixed height between them. Yes, but when I resize the window, the hori...
by ValeV
Fri Jun 07, 2019 1:19 pm
Forum: C++ Development
Topic: Button is focused when I run application
Replies: 9
Views: 225

Re: Button is focused when I run application

doublemax wrote:
Fri Jun 07, 2019 10:48 am
But what about first button being focused on application start (my original question)?
Try setting the focus to the frame.

Code: Select all

this->SetFocus();
I see, I put focus on highest label, though your code works better. Thank you. :)
by ValeV
Fri Jun 07, 2019 11:57 am
Forum: C++ Development
Topic: wxStaticLine resizing
Replies: 14
Views: 327

Re: wxStaticLine resizing

Sorry, I forgot to add :shock: , when I resize the window (make it bigger), I don't want the staticLine to get bigger vertically (so it becomes like a square), I want it to expand just horizontally.
by ValeV
Fri Jun 07, 2019 11:38 am
Forum: C++ Development
Topic: wxStaticLine resizing
Replies: 14
Views: 327

wxStaticLine resizing

CodeBlocks with Mingw, wxWidget 3.1.2, wxSmith I can't figure out how to set wxStaticLine options to resize vertically, but with fixed height. I tried setting default width and height, checking "Shaped" option and setting max height size to 1, which normally works, but doesn't work when I resize the...
by ValeV
Fri Jun 07, 2019 9:53 am
Forum: C++ Development
Topic: Button is focused when I run application
Replies: 9
Views: 225

Re: Button is focused when I run application

When I click on any button in any of my apps, the focus stays on this button even after the button did his thing (the blue square around the button is still visible, like in my first picture in this forum thread). That's the default behavior under Windows. You should see this in all applications (n...
by ValeV
Fri Jun 07, 2019 6:13 am
Forum: C++ Development
Topic: Button is focused when I run application
Replies: 9
Views: 225

Re: Button is focused when I run application

I noticed additional bug/feature I don't like, in all my applications. When I click on any button in any of my apps, the focus stays on this button even after the button did his thing (the blue square around the button is still visible, like in my first picture in this forum thread). Surely there is...
by ValeV
Fri Jun 07, 2019 5:44 am
Forum: C++ Development
Topic: Button is focused when I run application
Replies: 9
Views: 225

Re: Button is focused when I run application

The only thing I can think of that should work on all platforms won't break the tab order is to add an extra hidden item and initially set the focus to it. For example, a frame with 4 buttons constructor might look like this: wxPanel* panel = new wxPanel(this); panel->Hide(); wxButton* button1 = ne...
by ValeV
Thu Jun 06, 2019 12:01 pm
Forum: C++ Development
Topic: Button is focused when I run application
Replies: 9
Views: 225

Button is focused when I run application

When I run the application I made, first button is focused (blue line going around it).

Picture of it: http://i68.tinypic.com/6xsnro.png

I don't want it to be focused at start. How can I fix it?

-ValeV
by ValeV
Wed Jun 05, 2019 1:06 pm
Forum: C++ Development
Topic: Resize windows to match text length
Replies: 3
Views: 118

Re: Resize windows to match text length

wxFrame (or wxWindow in general) has some useful functions: //The length of the text wxSize sL = GetTextExtent(FileDialog1->GetPath()); //The size of the client part of the window. wxSize sC = GetClientSize(); //Replace width sC.SetWidth(sL.GetWidth()); //New client size SetSize(sC); Layout(); Inse...
by ValeV
Wed Jun 05, 2019 11:28 am
Forum: C++ Development
Topic: Resize windows to match text length
Replies: 3
Views: 118

Resize windows to match text length

I want to resize the main window to be the same width as the text in status bar. Calling Layout() doesn't seem to help. void EDStoBinaryFrame::OnButton1Click(wxCommandEvent& event) { if (FileDialog1->ShowModal() == wxID_OK) { if (!(FileDialog1->GetPath().Upper().EndsWith(".EDS"))) { wxMessageBox("In...
by ValeV
Fri May 31, 2019 3:27 pm
Forum: C++ Development
Topic: Converting streams
Replies: 4
Views: 246

Re: Converting streams

Thanks for help. How do I write to wxOutputStream? But so far, this compiles with no errors. //read EDS binary file, "decrypt" it and save to input stream wxFFile inFile; inFile.Open(FileDialog1->GetPath(), "rb"); stringstream sstream; wxStringOutputStream sstream2(); uint8_t buffer; while (!inFile....