Search found 69 matches

by heinermueller
Sun Jan 26, 2020 10:31 pm
Forum: C++ Development
Topic: [Solved] Serialize wxTextAttrEx
Replies: 2
Views: 280

Re: Serialize wxTextAttrEx

I solved the issue with wxRichTextXMLHandler x; wxString st = x.CreateStyle(rtc->GetDefaultStyle()); somehow_store_string(st); and later reading it back with wxString ss = somehow_read_string(); if (ss.length() > 0) { ss.Replace("\"", ""); wxXmlNode xn; wxStringTokenizer t(ss); while (t.HasMoreToken...
by heinermueller
Wed Jan 22, 2020 9:35 pm
Forum: C++ Development
Topic: [Solved] Serialize wxTextAttrEx
Replies: 2
Views: 280

[Solved] Serialize wxTextAttrEx

Hi everybody, i would like to serialize wxTextAttrEx object which i get from a wxRichTextCtrl. Purpose would be to offer the last used style again when the user opens the application again. Is there a built-in method to serialize this class? I could not find any. I know that wxFont has wxString wxFo...
by heinermueller
Wed Nov 13, 2019 2:01 pm
Forum: Platform Related Issues
Topic: wxGTK Accelerators
Replies: 12
Views: 483

Re: wxGTK Accelerators

I read back with

Code: Select all

wxMenuitem* m1 = fileMenu->Append(wxID_HIGHEST + MENUOPEN, _("Open File\tCTRL+O"));
auto a = m1->GetAccel();
and there is an accelerator set, and it stays that way trough the application lifetime. So it gets initialized, but is not active. Shall i report this as a bug?
by heinermueller
Mon Nov 11, 2019 8:07 pm
Forum: Platform Related Issues
Topic: wxGTK Accelerators
Replies: 12
Views: 483

Re: wxGTK Accelerators

Hello doublemax, - yes, (our) both snippets are in the same file - MENULOADALL is defined like enum menuitems { MENURELOAD = 10 ,MENUNEW ,MENUOPEN ,MENUSAVE ,MENUSAVEAS ,MENUSAVEALL ,MENUSAVEALLAS ,MENULOADALL ... }; - i tried removing the translation macro _() and removed all other menu entries jus...
by heinermueller
Mon Nov 11, 2019 5:40 pm
Forum: Platform Related Issues
Topic: wxGTK Accelerators
Replies: 12
Views: 483

Re: wxGTK Accelerators

Hi David, thank you for the detailed answer! I checked for your suggestions and had a look inside the 'render' sample - it uses accelerators menuFile->AppendCheckItem(Render_DrawDisabled, "Draw in &disabled state\tCtrl-D"); - it catches them in the frame wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MEN...
by heinermueller
Mon Nov 11, 2019 10:03 am
Forum: Platform Related Issues
Topic: wxGTK Accelerators
Replies: 12
Views: 483

Re: wxGTK Accelerators

I think OP is complaining that on GTK he has to use accelerator table while MSW and OSX do not require it. Yes, we need an accelerator table to make shortcuts work. Our acceleration entries including the ones from the samples - when i copy them over to our code - do not work. Does anyone have any i...
by heinermueller
Fri Nov 08, 2019 7:32 pm
Forum: Platform Related Issues
Topic: wxGTK Accelerators
Replies: 12
Views: 483

Re: wxGTK Accelerators

What is your OS? What version of GTK+ do you use? Can you try a {dialogs} sample and see if the accelerators in the menu work there? OS is System: Host: mxw-mint Kernel: 4.15.0-54-generic x86_64 bits: 64 compiler: gcc v: 7.4.0 Desktop: Cinnamon 4.2.4 wm: muffin dm: LightDM Distro: Linux Mint 19.2 T...
by heinermueller
Fri Nov 08, 2019 4:16 pm
Forum: Platform Related Issues
Topic: wxGTK Accelerators
Replies: 12
Views: 483

wxGTK Accelerators

Hi all, i realized that the accelerators as we used to define them do not work under wxGTK3 and wx 3.0.4. It used to work (and works under win 2.8 and wxCocoa 3.x) like this: fileMenu->Append(wxID_HIGHEST + MENUOPEN, _("Open File\tCTRL+O")); but now we have to add a call to SetAcceleratorTable: wxAc...
by heinermueller
Thu Nov 07, 2019 12:51 pm
Forum: Compiler / Linking / IDE Related
Topic: wxWidgets + Windows + CMake
Replies: 9
Views: 711

Re: wxWidgets + Windows + CMake

Hi ONEEYEMAN, thanks for the hint. Actually we do have a quite large software (packet, with multiple exe and libraries) to compile. CMake looks like a great solution, especially when developers refuse to work with e.g. xcode =) The idea of having a single project-file, easily switching compilers, ID...
by heinermueller
Sat Nov 02, 2019 5:08 pm
Forum: Compiler / Linking / IDE Related
Topic: wxWidgets + Windows + CMake
Replies: 9
Views: 711

wxWidgets + Windows + CMake

Hi all, what is the correct way to set up CMake with wxWidgets? Under Linux, all you have to do is find_package(wxWidgets COMPONENTS core base qa adv net html gl propgrid richtext REQUIRED) and then include/link using the populated wxWidgets_USE_FILE/wxWidgets_LIBRARIES variables. Magic. Under Windo...
by heinermueller
Tue Oct 29, 2019 2:09 pm
Forum: Platform Related Issues
Topic: wxGTK + OpenGL + gtk3 + Display Scaling
Replies: 7
Views: 1048

Re: wxGTK + OpenGL + gtk3 + Display Scaling

gtk_widget_get_scale_factor( .. ) reports the correct current scale factor here, so the patch seems fine to me. Do you have any idea why the return value of gtk_widget_get_scale_factor is an int? There may be a display scaling of 150% resulting in a scale factor of 1.5 which is impossible to expres...
by heinermueller
Thu Oct 24, 2019 12:06 pm
Forum: Platform Related Issues
Topic: wxGTK + OpenGL + gtk3 + Display Scaling
Replies: 7
Views: 1048

Re: wxGTK + OpenGL + gtk3 + Display Scaling

unfortunately GetContentScaleFactor(); always reports 1.0, then i replaced it with a direct call to gdk_monitor_get_scale_factor( gdk_display_get_monitor (gdk_display_get_default(), 0)); which seems to work. Is this a bug, shall i report it? wx version is 3.0.4, gtk runtime is 3.22., gtk compile tim...
by heinermueller
Tue Oct 22, 2019 11:20 am
Forum: Platform Related Issues
Topic: wxGTK + OpenGL + gtk3 + Display Scaling
Replies: 7
Views: 1048

Re: wxGTK + OpenGL + gtk3 + Display Scaling

Interim solution: you can change the GDK scale factor by setting the

GDK_SCALE=1

factor in the environment variables. Using this solution now, since we do not know about the display scaling implications (glViewport and glScissor for sure, not sure about framebuffer objects)
by heinermueller
Tue Oct 22, 2019 9:13 am
Forum: Platform Related Issues
Topic: wxGTK + OpenGL + gtk3 + Display Scaling
Replies: 7
Views: 1048

wxGTK + OpenGL + gtk3 + Display Scaling

Hi All we are porting an application that already works under Windows and OSX to Linux (Mint) using wxGTK under gtk3. So far everything works surprisingly well with a simple recompilation. But we have a display issue: one of our laptops has a 4K screen, so gtk sets a dispaly scaling of 2. The result...