Search found 235 matches

by purplex88
Tue Sep 11, 2018 8:07 am
Forum: C++ Development
Topic: How can I load PNG files from Resource?
Replies: 9
Views: 1888

Re: How can I load PNG files from Resource?

Interestingly, it works only if I add the number ID with '#' with "RCDATA" string.
by purplex88
Tue Sep 11, 2018 8:04 am
Forum: C++ Development
Topic: How can I load PNG files from Resource?
Replies: 9
Views: 1888

Re: How can I load PNG files from Resource?

Yes, I also changed "PNG" to "RCDATA": IDB_PNG1 RCDATA "Settings1.png" IDB_PNG2 RCDATA "Settings2.png" IDB_PNG3 RCDATA "Settings3.png" and: wxInitAllImageHandlers(); wxBitmap BitmapSettings("IDB_PNG1", wxBITMAP_TYPE_PNG_RESOURCE); I rebuilt the project and it still won't work and ends up with same e...
by purplex88
Tue Sep 11, 2018 7:14 am
Forum: C++ Development
Topic: How can I load PNG files from Resource?
Replies: 9
Views: 1888

Re: How can I load PNG files from Resource?

I think I tried everything but same error: This is resource.h file #define IDI_ICON1 102 #define IDB_PNG1 107 #define IDB_PNG2 108 #define IDB_PNG3 109 This is .rc file // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_ICON1 ICON "icon1.ic...
by purplex88
Tue Sep 11, 2018 5:37 am
Forum: C++ Development
Topic: How can I load PNG files from Resource?
Replies: 9
Views: 1888

Re: How can I load PNG files from Resource?

Hi, I tried:

Code: Select all

wxBitmap BitmapSettings(wxBITMAP_PNG("#107"));
Where "#107" is resource ID of PNG.

Is it the same way I load Icons i.e. wxIcon("#101") ?
by purplex88
Tue Sep 11, 2018 5:07 am
Forum: C++ Development
Topic: How can I load PNG files from Resource?
Replies: 9
Views: 1888

How can I load PNG files from Resource?

I am on Windows using MSVC++14.0 with wxWidgets 3.1. What I am currently doing is loading PNG files from a path: wxBitmap BitmapSettings("D:\\Settings.png", wxBITMAP_TYPE_PNG); And setting them on a wxButton and achieving transparency: m_settings->SetBitmap(BitmapSettings); // For transparency m_set...
by purplex88
Mon Sep 10, 2018 2:04 pm
Forum: C++ Development
Topic: Positioning control at very left and right in frame
Replies: 2
Views: 631

Positioning control at very left and right in frame

I want a button control "Button 2" to be placed at the very right of the Window even if it is re-sized.
wxBoxSizer Controls.png
wxBoxSizer Controls.png (3.84 KiB) Viewed 630 times
Is it possible with wxBoxSizers?
by purplex88
Sat Sep 08, 2018 11:09 am
Forum: C++ Development
Topic: Setting Font Size in wxTextCtrl
Replies: 5
Views: 1338

Re: Setting Font Size in wxTextCtrl

However, It appears that Ctrl + key combination is already reserved for something and it doesn't trigger an event I want to handle.

Edit: Never mind, I am now using WXK_NUMPAD_ADD.
by purplex88
Sat Sep 08, 2018 11:07 am
Forum: C++ Development
Topic: Setting Font Size in wxTextCtrl
Replies: 5
Views: 1338

Re: Setting Font Size in wxTextCtrl

Oh, yes I was about to say that I found the solution.

I used GetFont and SetFont like this:

Code: Select all

wxFont font = m_textCtrl->GetFont();
font.SetPointSize(font.GetPointSize() + 1);
m_textCtrl->SetFont(font);
by purplex88
Sat Sep 08, 2018 10:56 am
Forum: C++ Development
Topic: Setting Font Size in wxTextCtrl
Replies: 5
Views: 1338

Re: Setting Font Size in wxTextCtrl

Yes, this is true.I also tried using SetDefaultStyle() but nothing changes.
by purplex88
Sat Sep 08, 2018 10:21 am
Forum: C++ Development
Topic: Setting Font Size in wxTextCtrl
Replies: 5
Views: 1338

Setting Font Size in wxTextCtrl

I am trying to zoom in wxTextCtrl by changing only font size: case '+': { if (event.ControlDown()) { wxTextAttr attr; int PointSize = m_textCtrl->GetFont().GetPointSize(); attr.SetFontPointSize(PointSize + 1); m_textCtrl->SetStyle(-1, -1, attr); } else event.Skip(); break; } case '-': { if (event.Co...
by purplex88
Sat Sep 01, 2018 1:30 am
Forum: C++ Development
Topic: SetScrollPos doesn't work correctly.
Replies: 7
Views: 939

Re: SetScrollPos doesn't work correctly.

Thanks. I was trying to center the position of line. I guess I can also that using ShowPosition easily.
by purplex88
Sat Sep 01, 2018 12:23 am
Forum: C++ Development
Topic: SetScrollPos doesn't work correctly.
Replies: 7
Views: 939

Re: SetScrollPos doesn't work correctly.

I have used other similar scroll functions they do work. What can I do to make this one function work?
by purplex88
Fri Aug 31, 2018 10:24 pm
Forum: C++ Development
Topic: SetScrollPos doesn't work correctly.
Replies: 7
Views: 939

Re: SetScrollPos doesn't work correctly.

It is wxTextCtrl. I am simply using it. m_textCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_RICH2); I think it is a known problem that other people faced as well in past. After SetScrollPos, the scroll does move but the window view doesn...
by purplex88
Fri Aug 31, 2018 10:08 pm
Forum: C++ Development
Topic: SetScrollPos doesn't work correctly.
Replies: 7
Views: 939

SetScrollPos doesn't work correctly.

After I call:

Code: Select all

m_textCtrl->SetScrollPos(wxVERTICAL, n, true);
The view never changes.

Is this a bug?

I am on Widows OS and using wxWidgets 3.1.
by purplex88
Fri Aug 31, 2018 4:59 pm
Forum: C++ Development
Topic: Text Selection Change Event for wxTextCtrl
Replies: 6
Views: 736

Re: Text Selection Change Event for wxTextCtrl

Windows 8.1 OS and wxWidgets 3.1. Perhaps, windows API allows for it?