A notebook based MDI in MSW?

wxWindows

    Next

  • 1. Linking error: wxApp::Initialize
    Hi All. Building with VC++ 9.0. I built the wxWidgets project in VC++, no problems. However, when I to compile a simple test app: I get this error: error LNK2001: unresolved external symbol "public: virtual bool __thiscall wxApp::Initialize(int &,wchar_t * *)" (?Initialize@wxApp@@UAE_NAAHPAPA_W@Z) Any ideas? Thanks Chris
  • 2. Microsoft-isms
    Hello, I work for a company that wishes to change over to use wxWidgets. For legacy reasons I have to ask these questions: - is wxWidgets compatible with COM? - is wxWidgets compatible with MFC? - is wxWidgets compatible with .NET framework? Thanks! Hello,<br>I work for a company that wishes to change over to use wxWidgets. For legacy reasons I have to ask these questions:<br>- is wxWidgets compatible with COM?<br>- is wxWidgets compatible with MFC?<br>- is wxWidgets compatible with .NET framework?<br> Thanks!

A notebook based MDI in MSW?

Postby tom » Mon, 23 May 2005 18:24:58 GMT

 I've been trying to figure out how to do this for two days now and a Google
search for the relevant terms returns nothing useful, so it's time to try
the list.  I need to get a wxNotebook based MDI working in MSW just like in
Julian Smart's DialogBlocks ( http://www.**--****.com/ ).

 At first glance thru the WX code it seems that it already exists in
src/generic/mdig.cpp, but I have not figured out how to use this
implementation.  Defining wxUSE_GENERIC_MDI_AS_NATIVE seems not to work.
Including mdig.cpp into the build doesn't seem to work.  Removing mdi.cpp
and adding mdig.cpp doesn't seem to work.  I'm now thinking that I have to
implement the functionality myself, but surely this cannot be the case.

 So am I over looking the obvious here or am I the first person try this? 

 Thanks for your help.

  Tom Spilman
  Co-owner | Programmer
  www.sickheadgames.com


---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby kholwerd » Mon, 23 May 2005 21:42:41 GMT

I think that this is not MDI in the sence as using classes in wxWidgets 
that have MDI in it.
I such a situation you have several windows/views draggable on the main 
frame.
You can have of course  wxNoteBooks  in all  of those windows.

Like i this application:
 
 http://www.**--****.com/ 

For  simple tab like windows this wil do:

 http://www.**--****.com/ 

All the above is based on wxArt2D and its docview version, but it might 
help you to understand what the solution is.

Klaas






---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby tom » Tue, 24 May 2005 03:06:16 GMT


 ROBOPro is not the behavior I'm looking for.  I need a normal MDI, but with
a wxMDIClientWindow derived from wxNotebook.  I know pretty much what I must
to do make this work:

  - wxMDIClientWindow must be derived from wxNotebook.
  - wxMDIChildFrame must be derived from wxPanel.

 But this seems to be exactly what the generic mdi does, so why should I
waste my time rebuilding it all?  Can someone tell me how to use the
wxGenericMDI classes in a Windows build?


 This seems to have multiple views on the same document... I need multiple
document support.

  Tom Spilman
  Co-owner | Programmer
  www.sickheadgames.com






---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby kholwerd » Tue, 24 May 2005 05:02:22 GMT



An that is?? I only no an MDI fashion where for each document there is a 
view or more then one view.
And Each of them has its window which you can drag.
The notebook fashion was something to emulate MDI on Linux, but is 
becoming popular all around.
e.g in VC7 you can switch from MDI style to tabbed document style.

It is also that.

Klaas

---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby biol75 » Tue, 24 May 2005 05:06:17 GMT

if you compile with the universal port, do you get the look you seek?
chris




---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby tom » Tue, 24 May 2005 05:38:55 GMT




 The VC7 tabbed document style is what I'm trying to achieve.


 Where can I find the source code for wxArt2d?  I found a sourceforge
project, but so far I haven't found the docview code in their CVS tree.




 I compiled docvwmdi with the Universal Debug build and it crashes when I
try to open a new file.  Still doesn't Universal avoid using any native
controls?  If it did work I may have tabbed document views, but no native
Windows controls.

  Tom Spilman
  Co-owner | Programmer
  www.sickheadgames.com





---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby kholwerd » Tue, 24 May 2005 05:57:22 GMT

its in directory modules/docview.
There is only CVS.

BTW did you try wxUSE_GENERIC_MDI_AS_NATIVE ?
It looks like that setting might achive what you want. (see mdig.cpp)

Klaas

---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby tom » Tue, 24 May 2005 11:10:54 GMT


 That's one of the first things I tried.  I guessed that I should stick
#define wxUSE_GENERIC_MDI_AS_NATIVE 1 into my setup.h, but on a rebuild it
changed nothing.  I then noticed that mdig.cpp is excluded from MSW builds.
So I added that to the build... That caused redefinitions of some functions
in mdi.cpp.  That's when I figured I'd search Google for some mention of
wxUSE_GENERIC_MDI_AS_NATIVE and found only one mention from 2002 and it
seemed like an unresolved issue... I guess it still is.

  Tom Spilman
  Co-owner | Programmer
  www.sickheadgames.com





---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: A notebook based MDI in MSW?

Postby julian » Wed, 25 May 2005 19:30:38 GMT




Ports would need to remove their native implementation if this symbol
was 1. I guess not enough people have thought this was a useful enough thing
to do, but patches are welcome. This wouldn't work well on Mac though
since wxNotebook is used by the generic MDI implementation, and notebooks
on Mac can have a limited number of tabs (leading back to the discussion
of a different kind of tab/notebook control...)

Regards,

Julian




---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Similar Threads:

1.mdi in mdi in mdi - 2.6.2

Hi,

i need a nother mdi layer! My Mainframe is derived from mdiParentFrame.
It contains a mdiChildFrame child1.

Now i want to be this child another mdi parent! But i cant figure out how.
If i just want to add a mdiChildFrame child2 to child1.

Is this even possible?

it complains while  when i want to create child2 (cannont convert form
childframe* to parentfrafe*)
make the chil1 a mdiParentFrame didnt work either?

regards, Tobi


---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

2.MDI, XRC, and MSW

I've modified the XRC demo to use MDI for the main frame and a couple  
of the child frames (diffs follow). Once I figured out how to fire  
the handlers for MDI frames (wxResourceHandler::LoadObject() isn't in  
the manual, BTW), it works great on OSX and Debian.

M$W is another matter, though. The client window isn't drawn when the  
main frame first displays, but if you minimize and then restore it,  
it is... but that disables the toolbar.
I tried commenting out just about everything in the constructor, two- 
step creation of the main frame, hand-creating (instead of loading  
from XRC) the main frame, even making the main frame a global  
variable. Obviously, there's something there that I'm missing,  
because the MDI sample does work.

Any ideas?

Regards,
John Ralls



--- /usr/local/src/wxMac-2.8.6/samples/xrc/custclas.h	2007-09-25  
02:09:59.000000000 -0700
+++ custclas.h	2007-12-26 18:03:41.000000000 -0800
@@ -81,6 +81,16 @@

  };

+class CustClassFrame : public wxMDIChildFrame {
+public:
+CustClassFrame() : wxMDIChildFrame() {}
+
+    ~CustClassFrame() {}
+    void OnOK(wxCommandEvent& evt) { Hide(); }
+private:
+    DECLARE_EVENT_TABLE()
+};
+
  //-------------------------------------------------------------------- 
--------------------
  // End single inclusion of this .h file condition
  //-------------------------------------------------------------------- 
--------------------
--- /usr/local/src/wxMac-2.8.6/samples/xrc/custclas.cpp	2007-09-25  
02:09:59.000000000 -0700
+++ custclas.cpp	2007-12-26 18:03:41.000000000 -0800
@@ -59,6 +59,10 @@

  IMPLEMENT_DYNAMIC_CLASS( MyResizableListCtrl, wxListCtrl )

+BEGIN_EVENT_TABLE(CustClassFrame, wxFrame)
+EVT_BUTTON(wxID_OK, CustClassFrame::OnOK)
+END_EVENT_TABLE()
+
  //-------------------------------------------------------------------- 
---------
  // Event table: connect the events to the handler functions to  
process them
  //-------------------------------------------------------------------- 
---------
--- /usr/local/src/wxMac-2.8.6/samples/xrc/xrcdemo.h	2007-09-25  
02:09:59.000000000 -0700
+++ xrcdemo.h	2007-12-26 18:03:41.000000000 -0800
@@ -18,14 +18,19 @@
  // Headers
  //-------------------------------------------------------------------- 
---------

-#include "wx/app.h"             // wxApp

  //-------------------------------------------------------------------- 
---------
  // Class definition: MyApp
  //-------------------------------------------------------------------- 
---------

  // Define a new application type, each program should derive a  
class from wxApp
+#ifdef SW_USE_WX_APP_GUI_TESTING
+#include <wxGuiTest/swWxGuiTestApp.h>
+class MyApp : public swTst::WxGuiTestApp
+#else
+#include <wx/app.h>
  class MyApp : public wxApp
+#endif
  {

  public:
--- /usr/local/src/wxMac-2.8.6/samples/xrc/xrcdemo.cpp	2007-09-25  
02:09:59.000000000 -0700
+++ xrcdemo.cpp	2007-12-26 18:03:41.000000000 -0800
@@ -41,6 +41,9 @@
  #include "wx/cshelp.h"              // wxSimpleHelpProvider for  
helptext

  #include "myframe.h"
+#ifdef SW_USE_WX_APP_GUI_TESTING
+#include <wxGuiTest/swWxGuiTestHelper.h>
+#endif

  //-------------------------------------------------------------------- 
---------
  // wxWidgets macro: Declare the application.
@@ -120,7 +123,9 @@
      // Variable expansion example
      if (!wxXmlResource::Get()->Load(wxT("rc/variable.xrc")))
          return false;
-
+#ifdef  SW_USE_WX_APP_GUI_TESTING
+    wxTheApp->SetAppName(_T("xrcdemo_test"));
+#endif

  #if wxUSE_HELP
      // Use the simple help provider to show the context-sensitive help
--- /usr/local/src/wxMac-2.8.6/samples/xrc/derivdlg.cpp	2007-09-25  
02:09:59.000000000 -0700
+++ derivdlg.cpp	2007-12-29 11:41:51.000000000 -0800
@@ -35,7 +35,7 @@
  //-------------------------------------------------------------------- 
---------

  #include "wx/xrc/xmlres.h"              // XRC XML resouces
-
+
  //-------------------------------------------------------------------- 
---------
  // Event table: connect the events to the handler functions to  
process them
  //-------------------------------------------------------------------- 
---------
@@ -100,7 +100,11 @@
      if (msgDlg2.ShowModal() == wxID_OK)
      {
          // ...then end this Preferences dialog.
-        EndModal( wxID_OK );
+ #ifdef SW_USE_WX_APP_GUI_TESTING
+      Hide();
+#else
+       EndModal( wxID_OK );
+#endif
          // You could also have used event.Skip() which would then  
skip up
          // to the wxDialog's event table and see if there was a  
EVT_BUTTON
          // handler for wxID_OK and if there was, then execute that  
code.
--- /usr/local/src/wxMac-2.8.6/samples/xrc/myframe.h	2007-09-25  
02:09:59.000000000 -0700
+++ myframe.h	2007-12-26 18:03:41.000000000 -0800
@@ -25,7 +25,7 @@
  //-------------------------------------------------------------------- 
---------

  // Define a new frame type: this is going to be our main frame
-class MyFrame : public wxFrame
+class MyFrame : public wxMDIParentFrame
  {

  public:
--- /usr/local/src/wxMac-2.8.6/samples/xrc/myframe.cpp	2007-09-25  
02:09:59.000000000 -0700
+++ myframe.cpp	2007-12-29 16:17:12.000000000 -0800
@@ -25,7 +25,9 @@
  #endif

  #include "wx/sysopt.h"
-
+#ifdef SW_USE_WX_APP_GUI_TESTING
+#include <wxGuiTest/swWxGuiTestHelper.h>
+#endif
  //-------------------------------------------------------------------- 
---------
  // Header of this .cpp file
  //-------------------------------------------------------------------- 
---------
@@ -105,7 +107,8 @@
      // since this frame will always be the top window, and thus  
parentless.
      // However, the current approach has source code that can be  
recycled
      // for other frames that aren't the top level window.]
-    wxXmlResource::Get()->LoadFrame(this, parent, wxT("main_frame"));
+    bool success= wxXmlResource::Get()->LoadObject(this, parent, wxT 
("main_frame"), _T("wxMDIParentFrame"));
+	wxASSERT_MSG(success, _T("Load of Frame main_frame failed"));

      // Set the icon for the frame.
      SetIcon(wxICON(appicon));
@@ -172,9 +175,14 @@
      // Make an instance of our derived dialog, passing it "this"  
window
      // (the main frame) as the parent of the dialog. This allows  
the dialog
      // to be destructed automatically when the parent is destroyed.
-    PreferencesDialog preferencesDialog(this);
+    PreferencesDialog* preferencesDialog = new PreferencesDialog(this);
      // Show the instance of the dialog, modally.
-    preferencesDialog.ShowModal();
+#ifdef SW_USE_WX_APP_GUI_TESTING
+    swTst::WxGuiTestHelper::Show(preferencesDialog, true, true);
+#else
+    preferencesDialog->ShowModal();
+    preferencesDialog->Destroy();
+#endif
  }

  void MyFrame::OnAnimationCtrlPlay(wxCommandEvent& event)
@@ -249,25 +257,33 @@
  #endif

      // All done. Show the dialog.
+#ifdef SW_USE_WX_APP_GUI_TESTING
+    swTst::WxGuiTestHelper::Show(&dlg, true, true);
+#else
      dlg.ShowModal();
+#endif
  }


  void MyFrame::OnUncenteredToolOrMenuCommand(wxCommandEvent& WXUNUSED 
(event))
  {
-    wxDialog dlg;
-    wxXmlResource::Get()->LoadDialog(&dlg, this, wxT 
("uncentered_dialog"));
-    dlg.ShowModal();
+    wxDialog* dlg = new wxDialog;
+    wxXmlResource::Get()->LoadDialog(dlg, this, wxT 
("uncentered_dialog"));
+#ifdef SW_USE_WX_APP_GUI_TESTING
+    swTst::WxGuiTestHelper::Show(dlg, true, true);
+#else
+    dlg->ShowModal();
+#endif
  }


  void MyFrame::OnCustomClassToolOrMenuCommand(wxCommandEvent&  
WXUNUSED(event))
  {
-    wxDialog dlg;
-    wxXmlResource::Get()->LoadDialog(&dlg, this, wxT 
("custom_class_dialog"));
+    CustClassFrame* child = new CustClassFrame;
+    wxXmlResource::Get()->LoadObject(child, this, wxT 
("custom_class_child"), _T("wxMDIChildFrame"));

      // Make an instance of our new custom class.
-    MyResizableListCtrl* a_myResizableListCtrl = new  
MyResizableListCtrl(&dlg,
+    MyResizableListCtrl* a_myResizableListCtrl = new  
MyResizableListCtrl(child,
                                                  wxID_ANY,
                                                  wxDefaultPosition,
                                                  wxDefaultSize,
@@ -278,23 +294,27 @@
      // custctrl.xrc XRC file.
      wxXmlResource::Get()->AttachUnknownControl(wxT 
("custom_control_placeholder"),
                                                   
a_myResizableListCtrl);
-    dlg.ShowModal();
+    child->Show();
  }


  void MyFrame::OnPlatformPropertyToolOrMenuCommand(wxCommandEvent&  
WXUNUSED(event))
  {
-    wxDialog dlg;
-    wxXmlResource::Get()->LoadDialog(&dlg, this, wxT 
("platform_property_dialog"));
-    dlg.ShowModal();
+    wxMDIChildFrame* child = new wxMDIChildFrame;
+    wxXmlResource::Get()->LoadObject(child, this, wxT 
("platform_child"), wxT("wxMDIChildFrame"));
+    child->Show();
  }


  void MyFrame::OnArtProviderToolOrMenuCommand(wxCommandEvent&  
WXUNUSED(event))
  {
-    wxDialog dlg;
-    wxXmlResource::Get()->LoadDialog(&dlg, this, wxT 
("art_provider_dialog"));
-    dlg.ShowModal();
+    wxDialog* dlg = new wxDialog;
+    wxXmlResource::Get()->LoadDialog(dlg, this, wxT 
("art_provider_dialog"));
+#ifdef SW_USE_WX_APP_GUI_TESTING
+    swTst::WxGuiTestHelper::Show(dlg, true, true);
+#else
+    dlg->ShowModal();
+#endif
  }

---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

3.Newsbie Problems: Havin a Notebook within an MDI Frame

Hi!

Coming from C++Builder, i'm new to wxWidgets (2.5.2). Unfortunatly i don't
get all this sizer stuff and the documentation is not a good help. 

I'm fiddling with the MDI example. I want to replace the TextWindow on the
left side with a Notebook containing some buttons. Unfortunatly it never
got aligned the way i want and i don't know how to do it. I used wxGlade as
a reference, but it produces code thats obsolete (wxNotebookSizer), not to
mention that it doesn't work either. Here is my code snippet:

// Define my frame constructor
MyFrame::MyFrame(wxWindow *parent,
                 const wxWindowID id,
                 const wxString& title,
                 const wxPoint& pos,
                 const wxSize& size,
                 const long style)
       : wxMDIParentFrame(parent, id, title, pos, size,
                          style | wxNO_FULL_REPAINT_ON_RESIZE)
{
    //textWindow = new wxTextCtrl(this, wxID_ANY, _T("A help window"),
     //                           wxDefaultPosition, wxDefaultSize,
       //                         wxTE_MULTILINE | wxSUNKEN_BORDER);

    notebook_1 = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize,
0);
    notebook_1_pane_1 = new wxPanel(notebook_1, -1);
   wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
    notebook_1->AddPage(notebook_1_pane_1, wxT("tab1"));
    sizer_1->Add(new wxNotebookSizer(notebook_1), 1, wxEXPAND, 0);
    //sizer_1->Add(new wxBoxSizer(wxHORIZONTAL));
    sizer_1->Add(  new wxButton( this, wxID_OK, "OK" ),
     0,           // make horizontally unstretchable
     wxALL,       // make border all around (implicit top alignment)
     10 );        // set border width to 10
 SetAutoLayout(true);
    SetSizer(sizer_1);
    //sizer_1->Fit(this);
    //sizer_1->SetSizeHints(this);
    Layout();

#if wxUSE_TOOLBAR
    CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL);
    InitToolBar(GetToolBar());
#endif // wxUSE_TOOLBAR

...

This looks horrible. Can anybody help? Thanks in advance.

Cheers

Gunnar

4.MDI w/Notebook problem

Hi all,

I've been following along with the MDI sample included with wxWindows 
(mdi.exe) and adapting it for the interface I want to create. On the left 
hand side in the sample is a wxTextCtrl box. I liked that idea but needed a 
couple of extra controls so I'm trying to change that to wxNotebook. 

After changing it to wxNotebook, I compile and run the program but the 
Notebook is not appearing. I've added a panel to place the notebook on but 
it still isn't appearing.

Any ideas on what is causing the Notebook control to not show up? And why 
would it be any different from wxTextCtrl?

Thanks
Jody

5.window menu for mdi based application

Hi all,
I've a problem. I've an application based on wxwidgets and it's MDI. In 
its previous version (based on wxwindows 2.2.9) I notice that the window 
menu contains a dynamic list with the opened mdi child, in this 
version(based on 2.6.3) I see the window menu with the classical item 
but not this dynamic list. Does anybody know how to implement it?

thank you
bye

---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

6. notebook sample crashes on MSW with wxUSE_STL

7. [MSW 2.6.0] Wrong color of toolbar on notebook page when using xp theme

8. How can I delete the close button on all MDI windows in an MDI app



Return to wxWindows

 

Who is online

Users browsing this forum: No registered users and 80 guest