Search the web
Sign In
New User? Sign Up
wxMS_developers · Development with wxWidgets on MSWindows
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How do you organize your source files?   Message List  
Reply | Forward Message #663 of 693 |
Hello,

I want a clear separation between the UI and the business logic.

How do you achieve this? How do you organize your source files for your
applications? Which folders do you generally create?

I have tried this for my first wxWidget application:
\main.cpp
\MyApp.h
\MyApp.cpp
\Controllers\MyAppController.h
\Controllers\MyAppController.cpp
\Models\MyAppModel.h
\Models\MyAppModel.cpp
\Views\MyMainWindow.h
\Views\MyMainWindow.cpp

- main.cpp contains only DECLARE_APP(MyApp) and IMPLEMENT_APP(MyApp)
- the MyApp class inherits from wxApp. MyApp.cpp contains the OnInit method and
creates a MyAppController object
- the MyAppController object creates a MyAppModel object and a MyMainWindow
object
- MyAppModel is the core of the application and knows nothing about the GUI
- MyMainWindow inherits from wxFrame and is the main window of the application

As you can see I've been trying to implement the MVC (model/view/controller)
pattern. But I don't know where's the best place to put the event handlers.


How do you organize your source files? Where do you catch events?

Kind regards,
Al





Wed Mar 4, 2009 7:24 pm

al_lo_ja
Offline Offline
Send Email Send Email

Forward
Message #663 of 693 |
Expand Messages Author Sort by Date

Hello, I want a clear separation between the UI and the business logic. How do you achieve this? How do you organize your source files for your applications?...
al_lo_ja
Offline Send Email
Mar 4, 2009
7:24 pm

I derive my controller from Frame and put the events there. My view creates a view given a wxDC. My events pass relevant information to the model. The...
Ralph Pass
rppassiii
Offline Send Email
Mar 4, 2009
9:09 pm

Thanks for your reply, Ralph. I added a zip file in the Files section called MVCTest.zip. It contains a demo app to illustrate the MVC concept with wxWidgets. ...
al_lo_ja
Offline Send Email
Mar 5, 2009
11:57 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help