wxwidgets

关于wxWidgets控件出现乱码

旧街凉风 提交于 2021-02-15 09:36:45
这两天在用wxWidgets做一个小程序,突然遇到了一个控件显示出现乱码的问题。 首先声明:我用的编译器是Visual Studio 2005,wxWidgets版本是2.8.12,下面的解决方法不一定对所有的平台都有效。 我们知道,wxWidgets中控件显示字符串一般都是用wxString,例如下面的一小段代码创建并显示一个按钮: // 创建一个按钮,显示名称就是“按钮” wxButton* oneButton = new wxButton( itemFrame1, ID_BUTTON, wxT("按钮"), wxDefaultPosition, wxDefaultSize, 0); // 把这个按钮放在一个BoxSizer中 itemBoxSizer->Add(oneButton, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); 上面的代码没有错误,显示截图如下: 但是,很多情况下,我们想要显示的控件的标签是先放在char *中的,我们当然要先转换成wxString,转换的方法有很多,比如用wxString::FromUTF8(),或者可以定义一个wxString对象,调用Printf方法。然而,两种方法都不行。 如下代码: char *label = "按钮"; wxString wxLabel; wxLabel.Printf(wxT("%s")

Error with suppressing icon in Windows tray area on Notification message via wxWidgets

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 13:54:58
问题 I have a C++ wxWidgets application wherein I am trying suppress the additional icon that pops up in the tray area when I need to display a notification (toast) message to the user. To do this, I need to call wxNotificationMessage::MSWUseToasts which under Windows 10 will suppress that icon. The parameters to that function call are a shortcut file path and the application user model id. Looking at the implementation of how wxWidgets does Toast Notification, the shortcut will have the lnk

wxSound. Undefined reference to PlaySoundW@12

醉酒当歌 提交于 2021-02-05 08:25:07
问题 I try to use wxSound to play sound, but when I try to compile and linking all project. I have this error: C:\wxWidgets-3.0.2\build\msw/../../include/wx/msw/winundef.h:171: undefined reference to `PlaySoundW@12' I Google it and got the answer about adding option -lwinmm to the linker. But it doesn't help 回答1: What are you compiling and linking exactly? Have you tried building the sound sample that comes with wxWidgets? This function is definitely in winmm.lib and wxWidgets makefiles already

Wxpython panel is cropped with only a small box shown at the top left hand corner

别来无恙 提交于 2021-01-29 18:58:39
问题 I am using Hide() and Show() from wx to do the "next page" effect by hiding a panel and showing the next one but in the same frame (not very sure if I am doing it correctly though). At certain pages, the panel is just a small cropped version at the top left corner while some other panels can work normally (display the full thing). How do I solve this problem? I saw something on stackoverflow about child/parent of the panel or frame and tried changing my code but it does not work, not very

Failed to build WxWidgets with GCC in command prompt

柔情痞子 提交于 2021-01-29 10:45:03
问题 I am following the official instructions to build WxWidgets with GCC. For some reason, it fails to build and gives me this error: Could someone tell me what is the problem here? I did try to use Cygwin to build, but encountered error when trying this line: ../configure --enable-debug It complained: -bash: ../configure: No such file or directory I am at the end of my wits now, and cannot figure out how to get it done. Someone please help. This is what PATH shows up in commmand prompt: ========

wxPython UltimateListCtrl Error After Deleting Row

删除回忆录丶 提交于 2021-01-29 07:14:17
问题 I have been working with wxPython and UltimateListCtrl to create a GUI for a project. For my GUI is have a few panels that have UltimateListCtrls and have I run into an issue I cant seem to fix. My GUI consists of a list of files with 5 columns: a CheckBox Column, a File Name Column, a File Extension Column, a File Size Column, and a ComboBox Column. Example GUI Below the list I have a button that, when clicked, will delete any row whose CheckBox is checked. My issue comes after I delete, for

wxPython: how to lay one panel over another

半腔热情 提交于 2021-01-28 03:26:44
问题 This is about wxPython. I would like to have 2 Panels laying one over the other: PanelBG should be some sort of a "background", with its own GridBagSizer with subPanels, StaticTexts and so on; PanelFG should be the "foreground" panel, also with its own GridBagSizer with some StaticTexts, Buttons... but a transparent background, in such a way that PanelBG is visible wherever PanelFG doesn't lay widgets. I need both Panels to stretch to all the sides of the frame, even when resizing the window,

CMake: find wxWidgets built with MinGW/MSYS?

空扰寡人 提交于 2021-01-28 00:01:08
问题 I compiled wxWidgets 2.8.12 using MinGW. To actually do the build I invoked the autotools build files distributed with wxWidgets through the MSYS shell, using an install prefix of H:\MinGW-libs. The result of this is that I have a Unix style file tree containing my wxWidgets headers and libs (which are .a files, not .dll) with root directory H:\MinGW-libs. My problem is that I can't get CMake to find the files. When I try to use the "configure" button in the CMake gui it finds other

Unable to open a local HTML file generated in folium using wxPython

烈酒焚心 提交于 2021-01-27 22:52:54
问题 I am currently trying to plot GPS coordinates as markers on a map and displaying the result within wxPython. I have used folium to plot coordinate markers and generate an HTML file: import folium fmap = folium.Map([-43.5321,172.6362], zoom_start=12) folium.Marker([-43.5321,172.6362], popup='Marker1').add_to(fmap) fmap.save('maparea.html') I am able to open this HTML file in Firefox without any issues. I need to create a programme in wxPython to display this HTML file, and I tried implementing

Formatting wx.TextCtrl with numeric values only - float precision

▼魔方 西西 提交于 2021-01-27 18:02:00
问题 I have created a simple app which uses bare TextCtrl widgets with wxFILTER_NUMERIC in order to accept only numerical values (see code below). I want the values to have a fixed display precision irrespective of how user inputs them (e.g. will always show 17.0000 in case of 17.0 or 17.000000 values being specified). I found that in wxPython there is an option to use a derived NumCtrl widget (http://wxpython.org/docs/api/wx.lib.masked.numctrl-module.html) which does the job but I can't find it