Search Results

Search found 142 results on 6 pages for 'wxwidgets'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • How do I make C++/wxWidgets code accessible to a wxPython app?

    - by Jon Cage
    I have a code library which is written in C++ and makes extensive use of the wxWidgets library. I'm now trying to wrap my library (currently using SWIG) so that it's callable from wxPython, but I've hit a wall: ------ Build started: Project: MyLibLib, Configuration: Release_SWIG_OutputForBin Win32 ------ Performing Custom Build Step In order to function correctly, please ensure the following environment variables are correctly set: PYTHON_INCLUDE: C:\Python26\include PYTHON_LIB: C:\Python26\libs\python26.lib d:\MyProject\Software\MyLib\trunk\MyLib>C:\swigwin-2.0.0\swig.exe -python d:\MyProject\Software\MyLib\trunk\MyLibLib\MyLib.i d:\MyProject\Software\MyLib\trunk\MyLib>if errorlevel 1 goto VCReportError d:\MyProject\Software\MyLib\trunk\MyLib>goto VCEnd Compiling... MyLib_wrap.c C:\wxWidgets-2.8.10\include\wx/wxchar.h(886) : warning C4273: '_snprintf' : inconsistent dll linkage c:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(358) : see previous definition of '_snprintf' C:\wxWidgets-2.8.10\include\wx/buffer.h(127) : error C2061: syntax error : identifier 'wxCharBuffer' C:\wxWidgets-2.8.10\include\wx/buffer.h(127) : error C2059: syntax error : ';' C:\wxWidgets-2.8.10\include\wx/buffer.h(127) : error C2449: found '{' at file scope (missing function header?) C:\wxWidgets-2.8.10\include\wx/buffer.h(127) : error C2059: syntax error : '}' C:\wxWidgets-2.8.10\include\wx/buffer.h(127) : error C2059: syntax error : ')' C:\wxWidgets-2.8.10\include\wx/buffer.h(129) : error C2061: syntax error : identifier 'wxWritableCharBuffer' C:\wxWidgets-2.8.10\include\wx/buffer.h(129) : error C2059: syntax error : ';' C:\wxWidgets-2.8.10\include\wx/buffer.h(129) : error C2059: syntax error : ':' C:\wxWidgets-2.8.10\include\wx/buffer.h(134) : error C2061: syntax error : identifier 'wxWCharBuffer' C:\wxWidgets-2.8.10\include\wx/buffer.h(134) : error C2059: syntax error : ';' C:\wxWidgets-2.8.10\include\wx/buffer.h(134) : error C2449: found '{' at file scope (missing function header?) C:\wxWidgets-2.8.10\include\wx/buffer.h(134) : error C2059: syntax error : '}' C:\wxWidgets-2.8.10\include\wx/buffer.h(134) : fatal error C1004: unexpected end-of-file found Build log was saved at "file://d:\MyProject\Software\MyLib\trunk\MyLib\Release_SWIG_OutputForBin\BuildLog.htm" MyLibLib - 13 error(s), 1 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Is there a particular way I should be going about this? I spent some time googling for similar errors, but got none which suggests I'm probably barking up the wrong tree here...? [Edit] Is a dll and ctypes the answer?

    Read the article

  • wxWidgets: How to initialize wxApp without using macros and without entering the main application l

    - by m_pGladiator
    We need to write unit tests for a wxWidgets application using Google Test Framework. The problem is that wxWidgets uses the macro IMPLEMENT_APP(MyApp) to initialize and enter the application main loop. This macro creates several functions including int main(). The google test framework also uses macro definitions for each test. One of the problems is that it is not possible to call the wxWidgets macro from within the test macro, because the first one creates functions.. So, we found that we could replace the macro with the following code: wxApp* pApp = new MyApp(); wxApp::SetInstance(pApp); wxEntry(argc, argv); That's a good replacement, but wxEntry() call enters the original application loop. If we don't call wxEntry() there are still some parts of the application not initialized. The question is how to initialize everything required for a wxApp to run, without actually running it, so we are able to unit test portions of it?

    Read the article

  • wxWidgets in Code::Blocks

    - by Vlad
    Hello all, I'm trying to compile the minimal sample from the "Cross-Platform GUI Programming with wxWidgets" book but the following compile errors: ||=== minimal, Debug ===| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_frame.o):frame.cpp:(.text+0x918)||undefined reference to `__Unwind_Resume' | C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_frame.o):frame.cpp:(.text+0x931)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_frame.o):frame.cpp:(.text+0xa96)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_frame.o):frame.cpp:(.text+0xada)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_frame.o):frame.cpp:(.text+0xb1e)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_frame.o):frame.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_datacmn.o):datacmn.cpp:(.eh_frame+0x11)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp:(.text+0x63a)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp:(.text+0x696)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp:(.text+0x6f2)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp:(.text+0x74a)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp:(.text+0x7a2)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menu.o):menu.cpp:(.text+0x88f)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menu.o):menu.cpp:(.text+0x927)||undefined reference to `__Unwind_Resume' | C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menu.o):menu.cpp:(.text+0x9bf)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menu.o):menu.cpp:(.text+0xb8b)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menu.o):menu.cpp:(.text+0xc87)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menu.o):menu.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menucmn.o):menucmn.cpp:(.text+0xbc0)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menucmn.o):menucmn.cpp:(.text+0xc59)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menucmn.o):menucmn.cpp:(.text+0xcf5)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menucmn.o):menucmn.cpp:(.text+0xda6)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menucmn.o):menucmn.cpp:(.text+0xdce)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_menucmn.o):menucmn.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_icon.o):icon.cpp:(.text+0x1ff)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_icon.o):icon.cpp:(.text+0x257)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_icon.o):icon.cpp:(.text+0x2af)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_icon.o):icon.cpp:(.text+0x2fc)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_icon.o):icon.cpp:(.text+0x36d)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_icon.o):icon.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdiimage.o):gdiimage.cpp:(.text+0x4a8)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdiimage.o):gdiimage.cpp:(.text+0x73a)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdiimage.o):gdiimage.cpp:(.text+0x813)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdiimage.o):gdiimage.cpp:(.text+0xc06)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdiimage.o):gdiimage.cpp:(.text+0xd3e)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdiimage.o):gdiimage.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_event.o):event.cpp:(.text+0x970)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_event.o):event.cpp:(.text+0xa80)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_event.o):event.cpp:(.text+0xb8c)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_event.o):event.cpp:(.text+0xc78)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_event.o):event.cpp:(.text+0xd4f)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_event.o):event.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_appcmn.o):appcmn.cpp:(.text+0x2ef)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_appcmn.o):appcmn.cpp:(.text+0x32b)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_appcmn.o):appcmn.cpp:(.text+0x43d)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_appcmn.o):appcmn.cpp:(.text+0x586)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_appcmn.o):appcmn.cpp:(.text+0x601)||undefined reference to `__Unwind_Resume'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_appcmn.o):appcmn.cpp:(.eh_frame+0x12)||undefined reference to `___gxx_personality_v0'| C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_app.o):app.cpp:(.text+0x1da)||undefined reference to `__Unwind_Resume'| ||More errors follow but not being shown.| ||Edit the max errors limit in compiler options...| ||=== Build finished: 50 errors, 0 warnings ===| Here's the code sample from the book: #include "wx/wx.h" #include "mondrian.xpm" // Declare the application class class MyApp : public wxApp { public: // Called on application startup virtual bool OnInit(); }; // Declare our main frame class class MyFrame : public wxFrame { public: // Constructor MyFrame(const wxString& title); // Event handlers void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); private: // This class handles events DECLARE_EVENT_TABLE() }; // Implements MyApp& GetApp() DECLARE_APP(MyApp) // Give wxWidgets the means to create a MyApp object IMPLEMENT_APP(MyApp) // Initialize the application bool MyApp::OnInit() { // Create the main application window MyFrame *frame = new MyFrame(wxT("Minimal wxWidgets App")); // Show it frame->Show(true); // Start the event loop return true; } // Event table for MyFrame BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(wxID_ABOUT, MyFrame::OnAbout) EVT_MENU(wxID_EXIT, MyFrame::OnQuit) END_EVENT_TABLE() void MyFrame::OnAbout(wxCommandEvent& event) { wxString msg; msg.Printf(wxT("Hello and welcome to %s"), wxVERSION_STRING); wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnQuit(wxCommandEvent& event) { // Destroy the frame Close(); } MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) { // Set the frame icon SetIcon(wxIcon(mondrian_xpm)); // Create a menu bar wxMenu *fileMenu = new wxMenu; // The “About” item should be in the help menu wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about dialog")); fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // Now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, wxT("&File")); menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); // Create a status bar just for fun CreateStatusBar(2); SetStatusText(wxT("Welcome to wxWidgets!")); } So what's happenning? Thanks! P.S.: I installed wxWidgets through wxPack wich afaik comes with everything precomplied and i also added the wxWidgets directory to Global variables-base in Code::Blocks so everything should be correctly set, right?

    Read the article

  • Problems using wxWidgets (wxMSW) within multiple DLL instances

    Preface I'm developing VST-plugins which are DLL-based software modules and loaded by VST-supporting host applications. To open a VST-plugin the host applications loads the VST-DLL and calls an appropriate function of the plugin while providing a native window handle, which the plugin can use to draw it's GUI. I managed to port my original VSTGUI code to the wxWidgets-Framework and now all my plugins run under wxMSW and wxMac but I still have problems under wxMSW to find a correct way to open and close the plugins and I am not sure if this is a wxMSW-only issue. Problem If I use any VST-host application I can open and close multiple instances of one of my VST-plugins without any problems. As soon as I open another of my VST-plugins besides my first VST-plugin and then close all instances of my first VST-plugin the application crashes after a short amount of time within the wxEventHandlerr::ProcessEvent function telling me that the wxTheApp object isn't valid any longer during execution of wxTheApp-FilterEvent (see below). So it seems to be that the wxTheApp objects was deleted after closing all instances of the first plugin and is no longer available for the second plugin. bool wxEvtHandler::ProcessEvent(wxEvent& event) { // allow the application to hook into event processing if ( wxTheApp ) { int rc = wxTheApp->FilterEvent(event); if ( rc != -1 ) { wxASSERT_MSG( rc == 1 || rc == 0, _T("unexpected wxApp::FilterEvent return value") ); return rc != 0; } //else: proceed normally } .... } Preconditions 1.) All my VST-plugins a dynamically linked against the C-Runtime and wxWidgets libraries. With regard to the wxWidgets forum this seemed to be the best way to run multiple instances of the software side by side. 2.) The DllMain of each VST-Plugin is defined as follows: // WXW #include "wx/app.h" #include "wx/defs.h" #include "wx/gdicmn.h" #include "wx/image.h" #ifdef __WXMSW__ #include <windows.h> #include "wx/msw/winundef.h" BOOL APIENTRY DllMain ( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: { wxInitialize(); ::wxInitAllImageHandlers(); break; } case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: wxUninitialize(); break; } return TRUE; } #endif // __WXMSW__ class Application : public wxApp {}; IMPLEMENT_APP_NO_MAIN(Application) Question How can I prevent this behavior respectively how can I properly handle the wxTheApp object if I have multiple instances of different VST-plugins (DLL-modules), which are dynamically linked against the C-Runtime and wxWidgets libraries? Best reagards, Steffen

    Read the article

  • Any tips on reducing wxWidgets application code size?

    - by Billy ONeal
    I have written a minimal wxWidgets application: stdafx.h #define wxNO_REGEX_LIB #define wxNO_XML_LIB #define wxNO_NET_LIB #define wxNO_EXPAT_LIB #define wxNO_JPEG_LIB #define wxNO_PNG_LIB #define wxNO_TIFF_LIB #define wxNO_ZLIB_LIB #define wxNO_ADV_LIB #define wxNO_HTML_LIB #define wxNO_GL_LIB #define wxNO_QA_LIB #define wxNO_XRC_LIB #define wxNO_AUI_LIB #define wxNO_PROPGRID_LIB #define wxNO_RIBBON_LIB #define wxNO_RICHTEXT_LIB #define wxNO_MEDIA_LIB #define wxNO_STC_LIB #include <wx/wxprec.h> Minimal.cpp #include "stdafx.h" #include <memory> #include <wx/wx.h> class Minimal : public wxApp { public: virtual bool OnInit(); }; IMPLEMENT_APP(Minimal) DECLARE_APP(Minimal) class MinimalFrame : public wxFrame { DECLARE_EVENT_TABLE() public: MinimalFrame(const wxString& title); void OnQuit(wxCommandEvent& e); void OnAbout(wxCommandEvent& e); }; BEGIN_EVENT_TABLE(MinimalFrame, wxFrame) EVT_MENU(wxID_ABOUT, MinimalFrame::OnAbout) EVT_MENU(wxID_EXIT, MinimalFrame::OnQuit) END_EVENT_TABLE() MinimalFrame::MinimalFrame(const wxString& title) : wxFrame(0, wxID_ANY, title) { std::auto_ptr<wxMenu> fileMenu(new wxMenu); fileMenu->Append(wxID_EXIT, L"E&xit\tAlt-X", L"Terminate the Minimal Example."); std::auto_ptr<wxMenu> helpMenu(new wxMenu); helpMenu->Append(wxID_ABOUT, L"&About\tF1", L"Show the about dialog box."); std::auto_ptr<wxMenuBar> bar(new wxMenuBar); bar->Append(fileMenu.get(), L"&File"); fileMenu.release(); bar->Append(helpMenu.get(), L"&Help"); helpMenu.release(); SetMenuBar(bar.get()); bar.release(); CreateStatusBar(2); SetStatusText(L"Welcome to wxWidgets!"); } void MinimalFrame::OnAbout(wxCommandEvent& e) { wxMessageBox(L"Some text about me!", L"About", wxOK, this); } void MinimalFrame::OnQuit(wxCommandEvent& e) { Close(); } bool Minimal::OnInit() { std::auto_ptr<MinimalFrame> mainFrame( new MinimalFrame(L"Minimal wxWidgets Application")); mainFrame->Show(); mainFrame.release(); return true; } This minimal program weighs in at 2.4MB! (Executable compression drops this to half a MB or so but that's still HUGE!) (I must statically link because this application needs to be single-binary-xcopy-deployed, so both the C runtime and wxWidgets itself are set for static linking) Any tips on cutting this down? (I'm using Microsoft Visual Studio 2010)

    Read the article

  • wxWidgets errors occur after upgrading gDEBugger

    - by acekiller
    all. Today I upgraded my gDEBugger (though I don't think it involves gDEBugger) to the latest version but problem occurs. When I tried to open gDEBugger, an alert window named "wxWidgets Debug Alert" pop-up, reporting that "....\src\common\xpmdecod.cpp(822):assert "i==colors_cnt" failed in wxXPMDecoder::ReadData(). Call stack: [00]wxConsole....balabala....", like follows. All these words seem just like warnings and didn't affect the following work, however I am wondering why this problem occurs? What's the root cause? I am not familiar with wxWidgets and hopes those guru on it can help me resolve it.

    Read the article

  • wxWidgets EVT_KILL_FOCUS

    - by Wallter
    Q1:I am using wxWidgets (C++) and have come accost a problem that i can not locate any help. I have created several wxTextCtrl boxes and would like the program to update the simple calculations in them when the user 'kills the focus.' I could not find any documentation on this subject on the wxWidgets webpage and Googling it only brought up wxPython. The two events i have found are: EVT_COMMAND_KILL_FOCUS - EVT_KILL_FOCUS for neither of which I could find any snippet for. Could anyone give me a short example or lead me to a page that would be helpful? Q2:Would i have to create an event to handle the focus being killed for each of my 8 wxTextCtrl boxes? In the case that i have to create a different event: How would i get each event to differentiate from each other? Will i have to create new wxID's for each of the wxTextCtrl boxes? class BasicPanel : public wxPanel { ... wxTextCtrl* one; wxTextCtrl* two; wxTextCtrl* three; wxTextCtrl* four; ... }

    Read the article

  • C++ wxWidgets Event Handling

    - by Wallter
    Q1:I am using wxWidgets (C++) and have come accost a problem that i can not locate any help. I have created several wxTextCtrl boxes and would like the program to update the simple calculations in them when the user 'kills the focus.' I could not find any documentation on this subject on the wxWidgets webpage and Googling it only brought up wxPython. The two events i have found are: EVT_COMMAND_KILL_FOCUS - EVT_KILL_FOCUS for neither of which I could find any snippet for. Could anyone give me a short example or lead me to a page that would be helpful? Q2:Would i have to create an event to handle the focus being killed for each of my 8 wxTextCtrl boxes? In the case that i have to create a different event: How would i get each event to differentiate from each other? I know i will have to create new wxID's for each of the wxTextCtrl boxes but how do I get the correct one to be triggered? class BasicPanel : public wxPanel { ... wxTextCtrl* one; wxTextCtrl* two; wxTextCtrl* three; wxTextCtrl* four; ... }

    Read the article

  • C++ wxWidgets Event (Focus) Handling

    - by Wallter
    Due to comments I added the following code (in BasicPanel) Connect(CTRL_ONE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_TWO,wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_THREE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_FOUR, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); Connect(CTRL_FIVE, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&BasicPanel::OnKillFocus); (enums) CTRL_NAME = wxID_HIGHEST + 5, // 6004 CTRL_ADDRESS = wxID_HIGHEST + 6, // 6005 CTRL_PHONENUMBER = wxID_HIGHEST + 7, // 6006 CTRL_SS = wxID_HIGHEST + 8, // 6007 CTRL_EMPNUMBER = wxID_HIGHEST + 9 // 6008 (The OnKillFocus Function - the declaration is included as suggested) void BasicPanel::OnKillFocus(wxFocusEvent& event) { switch (event.GetId()) { case 6004: ... break; ... ... ... } All of these added to the code do nothing when the user changes focus on which text box they are using... Q1:I am using wxWidgets (C++) and have come accost a problem that i can not locate any help. I have created several wxTextCtrl boxes and would like the program to update the simple calculations in them when the user 'kills the focus.' I could not find any documentation on this subject on the wxWidgets webpage and Googling it only brought up wxPython. The two events i have found are: EVT_COMMAND_KILL_FOCUS - EVT_KILL_FOCUS for neither of which I could find any snippet for. Could anyone give me a short example or lead me to a page that would be helpful? Q2:Would i have to create an event to handle the focus being killed for each of my 8 wxTextCtrl boxes? In the case that i have to create a different event: How would i get each event to differentiate from each other? I know i will have to create new wxID's for each of the wxTextCtrl boxes but how do I get the correct one to be triggered? class BasicPanel : public wxPanel { ... wxTextCtrl* one; wxTextCtrl* two; wxTextCtrl* three; wxTextCtrl* four; ... }

    Read the article

  • wxWidgets exception handling

    - by Alex Farber
    When unhandled exception is handled in wxWidgets application in Windows, program shows Abort-Retry-Ignore message produced by Widgets exception handler. I want to get normal unhandled exception behavior: program should terminate with standard Windows unhandled exception dialog. Can I prevent Widgets to catch unhahnled exceptions?

    Read the article

  • wxWidgets running on other machine

    - by snorlaks
    Hello, I created application which uses wxWidgets library using visual studio 2008. Now I would like to create version which may be run on other machine. Because right now when I want to run It on another machine there is an error: the application failed to start because its side-by-side configuration is incorrect. What can I do to make It work ?

    Read the article

  • how to get the front window in wxwidgets

    - by Quincy
    In wxWidgets how to get the front most windows on mac? I have a document based application, so each window has a document in it, after change focus, I don't know how to get the front most window. I'm looking for a function like wxGetActiveWindow but the above function only works on windows and GTK, not mac

    Read the article

  • Is it easy to do IPC with wxWidgets?

    - by George Edison
    Is it easy to create an IPC setup with wxWidgets? I have an application that needs to detect if a previous instance is running and send a message to the running instance with a string value. Is there an easier way to do this than setting up a wxServer and wxClient-derived class?

    Read the article

  • wxWidgets: Show a window that was marked hidden in the XRC

    - by jdwieber
    I'm new to wxWidgets and DialogBlocks. I have a form that is created using DialogBlocks and saved as an XRC file. Part of the form has a vertical wxStaticBoxSizer into which is placed two wxScrolledWindow elements. I want to only show one at a time based on what data is to be shown to the user, so I have one marked hidden and left the other one visible. In code (C++), when I try to switch the display and show the widget that was hidden in the XRC and hide the one that was not, the one that I hide goes away fine, but the one that I want to show is not visible. If I resize the window however, it appears. Once it has appeard then I can switch back and forth with no issues. I tried many combinations of showing, enabling, invalidating, getting the sizer and calling RecalcSizes, refresh, layout, and some others. I tried them in different combinations too. Simply calling Show will allow me to toggle between the two, but only after I switch to the one that does not show initially and resize the window. From what I see in the docs. the issue is that wxSizer doesn't allocate space for hidden windows, but there is a flag that can be set to override that behavor. My problem is that DialogBlocks does not expose that feature, so if I manually edit the XRC file the modifation will be lost when I, or one of the other devs. saves some changes. Is ther a sequence of calls that I can make to tell the sizer to allocate space? The default OnResize handler does something to cause the sizer to allocate space, but I don't know what that is, or how to do it. This is the flag I found in the docs: wxRESERVE_SPACE_EVEN_IF_HIDDEN Normally wxSizers don't allocate space for hidden windows or other items. This flag overrides this behavior so that sufficient space is allocated for the window even if it isn't visible. This makes it possible to dynamically show and hide controls without resizing parent dialog, for example. This function is new since wxWidgets version 2.8.8 Thanks in advance.

    Read the article

  • qt/wxwidgets third party components?

    - by tkd
    I'm used to working in a Delphi and C# environment which seem to have a rich set of third party components available. I'm currently wanting to do cross-platform programming in C++ using either qt or wxwidgets. Is there a large market for third party components? I was looking at sourceforge and that doesn't seem to show much that is useful (how the hell do you find out what components or features are in a project without downloading the source?). I'm thinking carousel/coverflow components, rich datagrids (like the sort DevExpress provide). Or is this, write your own territory?

    Read the article

  • Load Excel data into Linux / wxWidgets C++ application?

    - by Milan Babuškov
    I'm using wxWidgets to write cross-plafrom applications. In one of applications I need to be able to load data from Microsoft Excel (.xls) files, but I need this to work on Linux as well, so I assume I cannot use OLE or whatever technology is available on Windows. I see that there are many open source programs that can read excel files (OpenOffice, KOffice, etc.), so I wonder if there is some library that I could use? Excel files it needs to support are very simple, straight tabular data. I don't need to extract any formatting except column/row position and the data itself.

    Read the article

  • WxWidgets custom events

    - by Klaus
    Hello, I'm trying to use a custom event in my WxWidgets C++ application, like described here. In the constructor of my wxApp: Connect(wxID_ANY, wxCommandEventHandler(APP::OnMyEvent)); Then the function that should catch the event: void APP::OnMyEvent(wxCommandEvent& event) { exit(0); //testing } Finally, to test it: wxCommandEvent MyEvent(wxEVT_COMMAND_BUTTON_CLICKED); wxPostEvent(this, MyEvent); I launch the thing...but it seems that the event is not posted or not caught. Does someone understand this behaviour ?

    Read the article

  • wxWidgets - Add items to sizer via DLL

    - by intl
    I have a GUI set up with wxWidgets (C++, MSVC) and part of the functionality is to add elements to the GUI via DLL's. Essentially, I would be passing in a sizer to the DLL which will in turn add the elements based on what is in the DLL. Could someone just point me in the right direction on how to get the DLL set up? I have looked, but don't see anything that's similar to what I'm looking for. The programming of the elements is fine with me, I just need to understand how to structure the DLL programming. Help appreciated.

    Read the article

  • Event Handlers Not Getting Called? - wxWidgets

    - by Alex
    Hello all, I'm working on a program for my C++ programming class, using wxWidgets. I'm having a huge problem in that my event handlers (I assume) are not getting called, because when I click on the button to trigger the event, nothing happens. My question is: Can you help me find the problem and explain why they would not be getting called? The event handlers OnAbout and OnQuit are working, just not OnCompute or OnClear. I'm really frustrated as I can't figure this out. Thanks a bunch in advance! #include "wx/wx.h" #include "time.h" #include <string> using std::string; // create object of Time class Time first; class App: public wxApp { virtual bool OnInit(); }; class MainPanel : public wxPanel { public: // Constructor for panel class // Constructs my panel class // Params - wxWindow pointer // no return type // pre-conditions: none // post-conditions: none MainPanel(wxWindow* parent); // OnCompute is the event handler for the Compute button // params - none // preconditions - none // postconditions - tasks will have been carried otu successfully // returns void void OnCompute(wxCommandEvent& WXUNUSED(event)); // OnClear is the event handler for the Clear button // params - none // preconditions - none // postconditions - all text areas will be cleared of data // returns void void OnClear(wxCommandEvent& WXUNUSED(event)); // Destructor for panel class // params none // preconditions - none // postconditions - none // no return type ~MainPanel( ); private: wxStaticText *startLabel; wxStaticText *endLabel; wxStaticText *pCLabel; wxStaticText *newEndLabel; wxTextCtrl *start; wxTextCtrl *end; wxTextCtrl *pC; wxTextCtrl *newEnd; wxButton *compute; wxButton *clear; DECLARE_EVENT_TABLE() }; class MainFrame: public wxFrame { private: wxPanel *mainPanel; public: MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size); void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); ~MainFrame(); DECLARE_EVENT_TABLE() }; enum { ID_Quit = 1, ID_About, BUTTON_COMPUTE = 100, BUTTON_CLEAR = 200 }; IMPLEMENT_APP(App) BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(ID_Quit, MainFrame::OnQuit) EVT_MENU(ID_About, MainFrame::OnAbout) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MainPanel, wxPanel) EVT_MENU(BUTTON_COMPUTE, MainPanel::OnCompute) EVT_MENU(BUTTON_CLEAR, MainPanel::OnClear) END_EVENT_TABLE() bool App::OnInit() { MainFrame *frame = new MainFrame( _("Good Guys Delivery Time Calculator"), wxPoint(50, 50), wxSize(450,340) ); frame->Show(true); SetTopWindow(frame); return true; } MainPanel::MainPanel(wxWindow* parent) : wxPanel(parent) { startLabel = new wxStaticText(this, -1, "Start Time:", wxPoint(75, 35)); start = new wxTextCtrl(this, -1, "", wxPoint(135, 35), wxSize(40, 21)); endLabel = new wxStaticText(this, -1, "End Time:", wxPoint(200, 35)); end = new wxTextCtrl(this, -1, "", wxPoint(260, 35), wxSize(40, 21)); pCLabel = new wxStaticText(this, -1, "Percent Change:", wxPoint(170, 85)); pC = new wxTextCtrl(this, -1, "", wxPoint(260, 85), wxSize(40, 21)); newEndLabel = new wxStaticText(this, -1, "New End Time:", wxPoint(180, 130)); newEnd = new wxTextCtrl(this, -1, "", wxPoint(260, 130), wxSize(40, 21)); compute = new wxButton(this, BUTTON_COMPUTE, "Compute", wxPoint(135, 185), wxSize(75, 35)); clear = new wxButton(this, BUTTON_CLEAR, "Clear", wxPoint(230, 185), wxSize(75, 35)); } MainPanel::~MainPanel() {} MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame( NULL, -1, title, pos, size ) { mainPanel = new MainPanel(this); wxMenu *menuFile = new wxMenu; menuFile->Append( ID_About, _("&About...") ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, _("E&xit") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, _("&File") ); SetMenuBar( menuBar ); CreateStatusBar(); SetStatusText( _("Hi") ); } MainFrame::~MainFrame() {} void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox( _("Alex Olson\nProject 11"), _("About"), wxOK | wxICON_INFORMATION, this); } void MainPanel::OnCompute(wxCommandEvent& WXUNUSED(event)) { int startT; int endT; int newEndT; double tD; wxString startTString = start->GetValue(); wxString endTString = end->GetValue(); startT = wxAtoi(startTString); endT = wxAtoi(endTString); pC->GetValue().ToDouble(&tD); first.SetStartTime(startT); first.SetEndTime(endT); first.SetTimeDiff(tD); try { first.ValidateData(); newEndT = first.ComputeEndTime(); *newEnd << newEndT; } catch (BaseException& e) { wxMessageBox(_(e.GetMessage()), _("Something Went Wrong!"), wxOK | wxICON_INFORMATION, this); } } void MainPanel::OnClear(wxCommandEvent& WXUNUSED(event)) { start->Clear(); end->Clear(); pC->Clear(); newEnd->Clear(); }

    Read the article

  • Event Handlers Not Getting Called? - wxWidgets & C++

    - by Alex
    Hello all, I'm working on a program for my C++ programming class, using wxWidgets. I'm having a huge problem in that my event handlers (I assume) are not getting called, because when I click on the button to trigger the event, nothing happens. My question is: Can you help me find the problem and explain why they would not be getting called? The event handlers OnAbout and OnQuit are working, just not OnCompute or OnClear. I'm really frustrated as I can't figure this out. Thanks a bunch in advance! #include "wx/wx.h" #include "time.h" #include <string> using std::string; // create object of Time class Time first; class App: public wxApp { virtual bool OnInit(); }; class MainPanel : public wxPanel { public: // Constructor for panel class // Constructs my panel class // Params - wxWindow pointer // no return type // pre-conditions: none // post-conditions: none MainPanel(wxWindow* parent); // OnCompute is the event handler for the Compute button // params - none // preconditions - none // postconditions - tasks will have been carried otu successfully // returns void void OnCompute(wxCommandEvent& WXUNUSED(event)); // OnClear is the event handler for the Clear button // params - none // preconditions - none // postconditions - all text areas will be cleared of data // returns void void OnClear(wxCommandEvent& WXUNUSED(event)); // Destructor for panel class // params none // preconditions - none // postconditions - none // no return type ~MainPanel( ); private: wxStaticText *startLabel; wxStaticText *endLabel; wxStaticText *pCLabel; wxStaticText *newEndLabel; wxTextCtrl *start; wxTextCtrl *end; wxTextCtrl *pC; wxTextCtrl *newEnd; wxButton *compute; wxButton *clear; DECLARE_EVENT_TABLE() }; class MainFrame: public wxFrame { private: wxPanel *mainPanel; public: MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size); void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); ~MainFrame(); DECLARE_EVENT_TABLE() }; enum { ID_Quit = 1, ID_About, BUTTON_COMPUTE = 100, BUTTON_CLEAR = 200 }; IMPLEMENT_APP(App) BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(ID_Quit, MainFrame::OnQuit) EVT_MENU(ID_About, MainFrame::OnAbout) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MainPanel, wxPanel) EVT_MENU(BUTTON_COMPUTE, MainPanel::OnCompute) EVT_MENU(BUTTON_CLEAR, MainPanel::OnClear) END_EVENT_TABLE() bool App::OnInit() { MainFrame *frame = new MainFrame( _("Good Guys Delivery Time Calculator"), wxPoint(50, 50), wxSize(450,340) ); frame->Show(true); SetTopWindow(frame); return true; } MainPanel::MainPanel(wxWindow* parent) : wxPanel(parent) { startLabel = new wxStaticText(this, -1, "Start Time:", wxPoint(75, 35)); start = new wxTextCtrl(this, -1, "", wxPoint(135, 35), wxSize(40, 21)); endLabel = new wxStaticText(this, -1, "End Time:", wxPoint(200, 35)); end = new wxTextCtrl(this, -1, "", wxPoint(260, 35), wxSize(40, 21)); pCLabel = new wxStaticText(this, -1, "Percent Change:", wxPoint(170, 85)); pC = new wxTextCtrl(this, -1, "", wxPoint(260, 85), wxSize(40, 21)); newEndLabel = new wxStaticText(this, -1, "New End Time:", wxPoint(180, 130)); newEnd = new wxTextCtrl(this, -1, "", wxPoint(260, 130), wxSize(40, 21)); compute = new wxButton(this, BUTTON_COMPUTE, "Compute", wxPoint(135, 185), wxSize(75, 35)); clear = new wxButton(this, BUTTON_CLEAR, "Clear", wxPoint(230, 185), wxSize(75, 35)); } MainPanel::~MainPanel() {} MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame( NULL, -1, title, pos, size ) { mainPanel = new MainPanel(this); wxMenu *menuFile = new wxMenu; menuFile->Append( ID_About, _("&About...") ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, _("E&xit") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, _("&File") ); SetMenuBar( menuBar ); CreateStatusBar(); SetStatusText( _("Hi") ); } MainFrame::~MainFrame() {} void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox( _("Alex Olson\nProject 11"), _("About"), wxOK | wxICON_INFORMATION, this); } void MainPanel::OnCompute(wxCommandEvent& WXUNUSED(event)) { int startT; int endT; int newEndT; double tD; wxString startTString = start->GetValue(); wxString endTString = end->GetValue(); startT = wxAtoi(startTString); endT = wxAtoi(endTString); pC->GetValue().ToDouble(&tD); first.SetStartTime(startT); first.SetEndTime(endT); first.SetTimeDiff(tD); try { first.ValidateData(); newEndT = first.ComputeEndTime(); *newEnd << newEndT; } catch (BaseException& e) { wxMessageBox(_(e.GetMessage()), _("Something Went Wrong!"), wxOK | wxICON_INFORMATION, this); } } void MainPanel::OnClear(wxCommandEvent& WXUNUSED(event)) { start->Clear(); end->Clear(); pC->Clear(); newEnd->Clear(); }

    Read the article

  • Not catching all mouse events with wxWidgets

    - by Stef
    Hi I am am trying to catch mouse movements for a MouseOver function in an app created with Code::Blocks using the wxSmith plugin. I have stumbled upon a puzzling problem. EVT_MOUSEWHEEL calling the function in the EventTable works well, but all other macros have no result at all. And the mousewheel is not really want I want (I just used it to test...) Here is a the basic problem code (mostly generated by the fantastic wxSmith plugin) MouseMain.h #include <wx/frame.h> #include <wx/statusbr.h> //*) class MouseFrame: public wxFrame { public: MouseFrame(wxWindow* parent,wxWindowID id = -1); virtual ~MouseFrame(); private: //(*Handlers(MouseFrame) void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); void OnButton1Click(wxCommandEvent& event); void MouseOver(wxMouseEvent& event); //*) //(*Identifiers(MouseFrame) static const long ID_BUTTON1; static const long ID_STATICBITMAP1; static const long ID_PANEL1; static const long idMenuQuit; static const long idMenuAbout; static const long ID_STATUSBAR1; //*) //(*Declarations(MouseFrame) wxButton* Button1; wxStaticBitmap* StaticBitmap1; wxPanel* Panel1; wxStatusBar* StatusBar1; //*) DECLARE_EVENT_TABLE() }; #endif // MOUSEMAIN_H ...and MouseMain.cpp #include "wx_pch.h" #include "MouseMain.h" #include <wx/msgdlg.h> //(*InternalHeaders(MouseFrame) #include <wx/bitmap.h> #include <wx/intl.h> #include <wx/image.h> #include <wx/string.h> //*) //helper functions enum wxbuildinfoformat { short_f, long_f }; wxString wxbuildinfo(wxbuildinfoformat format) { wxString wxbuild(wxVERSION_STRING); if (format == long_f ) { #if defined(__WXMSW__) wxbuild << _T("-Windows"); #elif defined(__UNIX__) wxbuild << _T("-Linux"); #endif #if wxUSE_UNICODE wxbuild << _T("-Unicode build"); #else wxbuild << _T("-ANSI build"); #endif // wxUSE_UNICODE } return wxbuild; } //(*IdInit(MouseFrame) const long MouseFrame::ID_BUTTON1 = wxNewId(); const long MouseFrame::ID_STATICBITMAP1 = wxNewId(); const long MouseFrame::ID_PANEL1 = wxNewId(); const long MouseFrame::idMenuQuit = wxNewId(); const long MouseFrame::idMenuAbout = wxNewId(); const long MouseFrame::ID_STATUSBAR1 = wxNewId(); //*) BEGIN_EVENT_TABLE(MouseFrame,wxFrame) EVT_RIGHT_DCLICK(MouseFrame::MouseOver) EVT_MOUSEWHEEL(MouseFrame::MouseOver) EVT_MOTION(MouseFrame::MouseOver) EVT_RIGHT_DOWN(MouseFrame::MouseOver) //(*EventTable(MouseFrame) //*) END_EVENT_TABLE() MouseFrame::MouseFrame(wxWindow* parent,wxWindowID id) { //(*Initialize(MouseFrame) wxMenuItem* MenuItem2; wxMenuItem* MenuItem1; wxMenu* Menu1; wxMenuBar* MenuBar1; wxFlexGridSizer* FlexGridSizer1; wxMenu* Menu2; Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id")); Panel1 = new wxPanel(this, ID_PANEL1, wxPoint(144,392), wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); FlexGridSizer1 = new wxFlexGridSizer(0, 3, 0, 0); Button1 = new wxButton(Panel1, ID_BUTTON1, _("TheButton"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1")); FlexGridSizer1->Add(Button1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticBitmap1 = new wxStaticBitmap(Panel1, ID_STATICBITMAP1, wxNullBitmap, wxDefaultPosition, wxSize(159,189), wxSUNKEN_BORDER, _T("ID_STATICBITMAP1")); FlexGridSizer1->Add(StaticBitmap1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); Panel1->SetSizer(FlexGridSizer1); FlexGridSizer1->Fit(Panel1); FlexGridSizer1->SetSizeHints(Panel1); MenuBar1 = new wxMenuBar(); Menu1 = new wxMenu(); MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL); Menu1->Append(MenuItem1); MenuBar1->Append(Menu1, _("&File")); Menu2 = new wxMenu(); MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL); Menu2->Append(MenuItem2); MenuBar1->Append(Menu2, _("Help")); SetMenuBar(MenuBar1); StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1")); int __wxStatusBarWidths_1[1] = { -1 }; int __wxStatusBarStyles_1[1] = { wxSB_NORMAL }; StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1); StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1); SetStatusBar(StatusBar1); Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&MouseFrame::OnButton1Click); Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MouseFrame::OnQuit); Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MouseFrame::OnAbout); //*) } MouseFrame::~MouseFrame() { //(*Destroy(MouseFrame) //*) } void MouseFrame::OnQuit(wxCommandEvent& event) { Close(); } void MouseFrame::OnAbout(wxCommandEvent& event) { wxString msg = wxbuildinfo(long_f); wxMessageBox(msg, _("Welcome to...")); } void MouseFrame::OnButton1Click(wxCommandEvent& event) { } void MouseFrame::MouseOver(wxMouseEvent& event){ wxMessageBox(_("MouseOver event!")); } So my big question: Why are EVT_MOTION, EVT_RIGHT_DOWN or EVT_RIGHT_DCLICK not calling MouseFrame::MouseOver(wxMouseEvent& event) in the way EVT_MOUSEWHEEL does?

    Read the article

  • Question regarding inheritance in wxWidgets.

    - by celestialorb
    Currently I'm attempting to write my own wxObject, and I would like for the class to be based off of the wxTextCtrl class. Currently this is what I have: class CommandTextCtrl : public wxTextCtrl { public: void OnKey(wxKeyEvent& event); private: DECLARE_EVENT_TABLE() }; Then later on I have this line of code, which is doesn't like: CommandTextCtrl *ctrl = new CommandTextCtrl(panel, wxID_ANY, *placeholder, *origin, *size); ...and when I attempt to compile the program I receive this error: error: no matching function for call to ‘CommandTextCtrl::CommandTextCtrl(wxPanel*&, <anonymous enum>, const wxString&, const wxPoint&, const wxSize&)’ It seems that it doesn't inherit the constructor method with wxTextCtrl. Does anyone happen to know why it doesn't inherit the constructor? Thanks in advance for any help!

    Read the article

1 2 3 4 5 6  | Next Page >