Search found 247 matches

by purplex88
Sun Dec 26, 2021 4:28 pm
Forum: C++ Development
Topic: Resize wxFrame according to child controls
Replies: 4
Views: 486

Re: Resize wxFrame according to child controls

Like

Code: Select all

SetSize(m_listctrl->GetSize());
?

It gets the list control size and sets the frame size accordingly. I don't see any effect of it.

Maybe, you're right, I could just leave it alone.
by purplex88
Sun Dec 26, 2021 3:06 pm
Forum: C++ Development
Topic: Resize wxFrame according to child controls
Replies: 4
Views: 486

Re: Resize wxFrame according to child controls

It already uses SetSizerAndFit() upon creation, I tried calling Fit() but it doesn't fit as expected. The window shrinks and fits.

The problem is when I add file to list control, its column size changes if file name is longer. When column size changes, scroll appears because wxFrame doesn't resize.
by purplex88
Sun Dec 26, 2021 8:11 am
Forum: C++ Development
Topic: Resize wxFrame according to child controls
Replies: 4
Views: 486

Resize wxFrame according to child controls

How can I resize wxFrame as list control size changes?
2.png
2.png (16.47 KiB) Viewed 486 times
I want to get rid of scroll bar and resize wxFrame as items are added into list control.
by purplex88
Thu Dec 23, 2021 6:48 pm
Forum: C++ Development
Topic: Control + A on List Control
Replies: 2
Views: 315

Re: Control + A on List Control

Yes, I will use both menu and keys for same commands. I am going to try accelerators and see if works. Update: Yes, it seems to work well. I set accelerators to list control: wxAcceleratorEntry entries[4]; entries[0].Set(wxACCEL_CTRL, (int)'A', SEL_ITEMS); entries[1].Set(wxACCEL_CTRL, (int)'D', FIND...
by purplex88
Thu Dec 23, 2021 6:49 am
Forum: C++ Development
Topic: Control + A on List Control
Replies: 2
Views: 315

Control + A on List Control

I am trying to catch Ctrl + A in order to select all listctrl items: m_list->Bind(wxEVT_LIST_KEY_DOWN, &TestDialog::OnKeyDown, this); void TestDialog::OnKeyDown(wxListEvent& event) { switch (event.GetKeyCode()) { case a: case A: { if (wxIsCtrlDown()) { // works! } } } } I wanted to avoid usi...
by purplex88
Wed Dec 22, 2021 6:43 am
Forum: C++ Development
Topic: Crash in Release Build due to wxString::Format
Replies: 5
Views: 529

Re: Crash in Release Build due to wxString::Format

Okay, I figured it. program was using size_t datatype which is typdef of unsigned int in x86 build but unsigned long long in x64 build. Can I make it work in both builds? I thought it was just "unsigned int" problem, but typedef made it tricky.
by purplex88
Sun Dec 19, 2021 11:54 am
Forum: C++ Development
Topic: Crash in Release Build due to wxString::Format
Replies: 5
Views: 529

Re: Crash in Release Build due to wxString::Format

As soon I cast it from unsigned int to int using

Code: Select all

(int)i
it runs in release build without crash using either "%u" or "%i". So, yes the problem exists there.

I tried "%u" again, it doesn't stop the crash.
by purplex88
Sun Dec 19, 2021 7:10 am
Forum: C++ Development
Topic: Crash in Release Build due to wxString::Format
Replies: 5
Views: 529

Crash in Release Build due to wxString::Format

I have unsigned int i; converted to string. This works fine in Debug build but in release build it causes an error: wxString::Format(wxT("%i"), i)); What's the correct format specifier? I have tried "%l" , "%u", "%lu" but none are working. Using wxWidgets 3.1.4
by purplex88
Sun Dec 19, 2021 6:38 am
Forum: C++ Development
Topic: Resize gif on wxAnimationCtrl
Replies: 2
Views: 424

Re: Resize gif on wxAnimationCtrl

Right so I resized the .gif itself. The 'wxAC_NO_AUTORESIZE' doesn't seem to be useful if it crops though..
by purplex88
Sat Dec 18, 2021 10:49 am
Forum: C++ Development
Topic: Resize gif on wxAnimationCtrl
Replies: 2
Views: 424

Resize gif on wxAnimationCtrl

I am looking at the sample code for wxAnimationCtrl given in \wxWidgets-3.1.4\samples\animate . Can I resize the control such that "throbber.gif" plays in small size? I tried "wxAC_NO_AUTORESIZE" flag but this crops the gif rather than resize it to the control. wxAnimationCtrl *m...
by purplex88
Mon Nov 16, 2020 11:07 pm
Forum: C++ Development
Topic: Simulatiing wxCloseEvent and wxMouseEvent
Replies: 4
Views: 583

Re: Simulatiing wxCloseEvent and wxMouseEvent

@doublemax and @PB: yes, both your insights were correct. I was simply trying to execute code in "mouse enter" function for a different scenario, but I moved it because it made no sense. Also it didn't make sense to call onClose but Close. I came up back to Winndows programming after a few...
by purplex88
Mon Nov 16, 2020 9:38 am
Forum: C++ Development
Topic: Simulatiing wxCloseEvent and wxMouseEvent
Replies: 4
Views: 583

Simulatiing wxCloseEvent and wxMouseEvent

Today, I was checking some of my code from years old and came across these lines: wxMouseEvent e; OnMouseEnter(e); // .... wxCloseEvent e; OnClose(e); First of all the code works but it seems like a bad design to directly call OnClose and OnMouseEnter event functions. I came across ProcessEvent func...
by purplex88
Thu Dec 12, 2019 4:54 pm
Forum: C++ Development
Topic: Control for text display, highlight and scroll
Replies: 27
Views: 3176

Re: Control for text display, highlight and scroll

Maybe then I should simply use a real web browser for this :wink:
by purplex88
Thu Dec 12, 2019 2:19 pm
Forum: C++ Development
Topic: Control for text display, highlight and scroll
Replies: 27
Views: 3176

Re: Control for text display, highlight and scroll

Thanks! If I just want to save the state of the html i.e. my highlights, can I use something called 'localStorage' https://javascript.info/localstorage ?
by purplex88
Thu Dec 12, 2019 12:05 am
Forum: C++ Development
Topic: Control for text display, highlight and scroll
Replies: 27
Views: 3176

Re: Control for text display, highlight and scroll

You saved me from taking the complete Javascript script course over this small effect I was trying to achieve. Well done :). All I need to do is export the highlighted text from the control as HTML file.