>I'm creating an applicatoin where I will have a common toolbar, menu, and panel (using one of the free XP-like collapseable panels on the left hand side). The bulk of the UI in my application (to the right of the panel and below the toolbar) will change based on your selections in the toolbar. This is simlar to Outlook where you have a single applicatin, but it's main UI form changes "modes" based on user actions. I could use MDI, but that's not really what I'm trying to accomplish. I could also use multiple panels and hide/show when buttons in the toolbar were clicked, but the main form will get pretty big (which is ok if it's my only option).
>
>Ideally I'd like to develop each "mode" seperately and just load them into the main window when the time comes... not sure if this is feasible (I tired it one time, but with a very convoluted approach >>> I had a main window, then created a new instance of the child window inside the parent with no chrome and placed it perfectly inside.
>
>Thanks in advance for the input.
>-AC
Great article...
Using that approach, what I'd like to do is have one of the modules control
or access the toolbar in the main window. This way, when a module was
activated, it could rebuild certain parts of the menu without having to do
this in another class. Possible?
-AC
> Hi !
>
[quoted text clipped - 6 lines]
>
> >I'm creating an applicatoin where I will have a common toolbar, menu, and panel (using one of the free XP-like collapseable panels on the left hand
side). The bulk of the UI in my application (to the right of the panel and
below the toolbar) will change based on your selections in the toolbar.
This is simlar to Outlook where you have a single applicatin, but it's main
UI form changes "modes" based on user actions. I could use MDI, but that's
not really what I'm trying to accomplish. I could also use multiple panels
and hide/show when buttons in the toolbar were clicked, but the main form
will get pretty big (which is ok if it's my only option).
> >Ideally I'd like to develop each "mode" seperately and just load them into the main window when the time comes... not sure if this is feasible (I
tired it one time, but with a very convoluted approach >>> I had a main
window, then created a new instance of the child window inside the parent
with no chrome and placed it perfectly inside.
> >Thanks in advance for the input.
> >-AC
[quoted text clipped - 3 lines]
> kaiboeNO_SPAM@online.no
> Norway
Elp - 09 Jul 2004 15:18 GMT
> Great article...
>
> Using that approach, what I'd like to do is have one of the modules
> control or access the toolbar in the main window. This way, when a
> module was activated, it could rebuild certain parts of the menu
> without having to do this in another class. Possible?
You could for example pass a reference to your tool bar or your main form to
your user control when you create it. This way, your user control could
modify it itself. You could also have a look at the Parent property of your
user control. You could maybe do something with that.
However, i would rather not try to modify a user control's container from
the user control. This would break your code if you want latter to use your
module in another application that has a different user interface. My
approach would be to have a manager class in charge of creating of managing
all your modules (this manager class could be simply your main form class).
This manager class would be in charge of modifying your tool bar in regards
to which module is displayed. If a module needs to modify your main form's
menus, tool bars or status bar at some stage, expose events in your module.
The manager will subscribe to those events and handle the main form UI
modification itself. This way, your modules will be totally independant from
where and how they are placed and used. This will also make your code much
more readable as it will be clearly sperarated into different independant
components.
AC - 09 Jul 2004 15:46 GMT
Funny... since i posted I just wanted to get it to work so I added some
stuff to the BaseModule class that would essentially allow you to pass a
reference from the main form to the module itself. then the module creates
the buttons on the toolbar on first time the module is fired off
after i got that working, I noticed that it would be better to build a
manager of sorts like you said. So now i'm working on actually rebuilding
the framework from the ground up and using some of the NetXP UI components.
-AC
> > Great article...
> >
[quoted text clipped - 21 lines]
> more readable as it will be clearly sperarated into different independant
> components.
Kai Bohli - 12 Jul 2004 00:45 GMT
Hi !
Sorry for my late reply. I'm on vacation, and have to sneak in to my computer after my better half
is asleep and at odd days :)
Anyway, I belive the answer to that is yes. If you look at the article, they build a menu up from
scratch when you select the "grid thingy". You can control this stuff in the baseclass or in the
inherited or both. Aka - the framework lets you control which menus, toolbars are visible through
the "register" functions embedded.
I found that I've lost too much control, and decided to use the framework itself, but take controls
of navigation and menus outside of the framework. Anyway, I've got it working and timesaving when
you want to make new forms and load them into the same panel.
BTW - to access a module's public function you'll have to write something like this:
((modModCust)ModuleInfoCollection.Instance[2].Module).PrintScheme();
I've also put in the following code in the "basemodule" so I can reach the mainform (parent) from
any inherited module. (module = usercontrol):
MainForm = ((frmMain)this.FindForm()); // points back to the mother of all form (or usercontrols)
// (or modules)
That way, I can forinstance say something like this from any module.
MainForm.ShowEditButtons();
>Great article...
>
>Using that approach, what I'd like to do is have one of the modules control
>or access the toolbar in the main window. This way, when a module was
>activated, it could rebuild certain parts of the menu without having to do
>this in another class. Possible?
Best wishes
Kai Bohli
kaiboeNO_SPAM@online.no
Norway