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...
Want to share photos of your group with the world? Add a group photo to Flickr.

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 #665 of 693 |
Re: How do you organize your source files?

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.
The form contains a text box with a value, and 2 buttons: increment, decrement.

The project does not contain the events, though, because I am not sure how to do
it.

Who can help and make the app work? I guess there is more than one way to do it.
It could be interesting to discuss these.
You can post your solution to the Files section.
Thanks!

Kind regards,
Al


--- In wxMS_developers@yahoogroups.com, Ralph Pass <rppass@...> wrote:
>
> 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 events also decide if it was such that the views need to be
> updated. It also checks the model to see if the model thinks the views
> need to be updated.
> Conceptually, I have the controllers separate from the models separate
> from the views.
>
> Ralph
>
> al_lo_ja wrote:
> >
> > 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
> >
> >
>





Thu Mar 5, 2009 11:57 pm

al_lo_ja
Offline Offline
Send Email Send Email

Forward
Message #665 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