Non-modal dialog in CSplitterWindow???

Hello newsgroup,

is it possible to show a non-modal dialog in a pane of a
CSplitterWindow? The documentation says that CSplitterWindow may contain
windows that are not views, but I have some doubts. Since
CSplitterWindow's CreateView method assumes that the window _IS_ a view
(it calls Wnd::Create, which is utterly inappropriate if I want to
create a modeless dialog), I don't see how I can use CSplitterWindow.

Is there any alternative to CSplitterWindow?


Some words about my project:
My app should display image data. This done via the common doc-view
approach. There must be a dialog that allows the user to change the
camera settings. This dialog must be visible the whole time. It should
not be a view (else clicking on this window would disable the toolbar
buttons, none of the buttons make sense for this window).

Thanks,
Stuart
0
DerTopper (96)
3/15/2006 4:46:25 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
811 Views

Similar Articles

[PageSpeed] 24

You could just use RUNTIME_CLASS() on the dialog class to put it in a view, 
but I'm not sure this would solve your problem.

You might want to put your toolbar code into the mainframe class or use 
OnCmdMsg() to route the messages to all of the views.  Then you could just 
us a CFormView for your dialog.

Tom

"Stuart Redmann" <DerTopper@web.de> wrote in message 
news:441844E1.91F6958E@web.de...
> Hello newsgroup,
>
> is it possible to show a non-modal dialog in a pane of a
> CSplitterWindow? The documentation says that CSplitterWindow may contain
> windows that are not views, but I have some doubts. Since
> CSplitterWindow's CreateView method assumes that the window _IS_ a view
> (it calls Wnd::Create, which is utterly inappropriate if I want to
> create a modeless dialog), I don't see how I can use CSplitterWindow.
>
> Is there any alternative to CSplitterWindow?
>
>
> Some words about my project:
> My app should display image data. This done via the common doc-view
> approach. There must be a dialog that allows the user to change the
> camera settings. This dialog must be visible the whole time. It should
> not be a view (else clicking on this window would disable the toolbar
> buttons, none of the buttons make sense for this window).
>
> Thanks,
> Stuart 


0
tserface (3860)
3/15/2006 5:04:27 PM
Stuart Redmann wrote:
> Hello newsgroup,
> 
> is it possible to show a non-modal dialog in a pane of a
> CSplitterWindow? The documentation says that CSplitterWindow may contain
> windows that are not views, but I have some doubts. Since
> CSplitterWindow's CreateView method assumes that the window _IS_ a view
> (it calls Wnd::Create, which is utterly inappropriate if I want to
> create a modeless dialog), I don't see how I can use CSplitterWindow.
> 
> Is there any alternative to CSplitterWindow?
> 
> 
> Some words about my project:
> My app should display image data. This done via the common doc-view
> approach. There must be a dialog that allows the user to change the
> camera settings. This dialog must be visible the whole time. It should
> not be a view (else clicking on this window would disable the toolbar
> buttons, none of the buttons make sense for this window).
> 
> Thanks,
> Stuart

If you really want a splitter, you probably should put a CFormView into 
the splitter pane instead of a dialog.  A CFormView is a view that 
displays a dialog template.  Using a CFormView will not disable the 
toolbar buttons if you put the OnUpdate... handlers in CMainFrame.

 From your description it sounds like you might not really want a 
splitter.  You can simply create a modeless dialog independent of the 
views (it would float above the view), or you can put the user controls 
on a CDialogBar (a strip along some edge of the view), or you could put 
them on a control pallette.  The MFC samples contains examples of all of 
these approaches.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
3/15/2006 9:28:15 PM
Tom Serface wrote:
> 
> You could just use RUNTIME_CLASS() on the dialog class to put it in a view,
> but I'm not sure this would solve your problem.
> 
> You might want to put your toolbar code into the mainframe class or use
> OnCmdMsg() to route the messages to all of the views.  Then you could just
> us a CFormView for your dialog.

This is quite an ugly workaround. Enabling and disabling toolbar command
is the responsibility of a view, the mainframe should not be burdened
with such tasks. Putting my dialog into a view won't do no good: I would
get back the problems that I got before I tried to make the view to a
dialog.


"Scott McPhillips [MVP]" wrote:
> If you really want a splitter, you probably should put a CFormView into
> the splitter pane instead of a dialog.  A CFormView is a view that
> displays a dialog template.  Using a CFormView will not disable the
> toolbar buttons if you put the OnUpdate... handlers in CMainFrame.

See above about putting the handlers in the main frame.

>  From your description it sounds like you might not really want a
> splitter.  You can simply create a modeless dialog independent of the
> views (it would float above the view), or you can put the user controls
> on a CDialogBar (a strip along some edge of the view), or you could put
> them on a control pallette.  The MFC samples contains examples of all of
> these approaches.

I want a dialog that does not float, but sits on the left side of the
frame window. One should be able to make it thinner (resize it
horizontally), so a splitter bar would be perfect. The dialog should be
able to scroll vertically, though.

Here is my (ugly) workaround: I use a CScrollView instead of the dialog.
This view has empty OnUpdate-handlers, so it won't mess with the tool
bar. Any OnCommands from the tool bar are routed by hand to the view.

I believe that this is quite unsophisticated. There should be a better
way to do this in MFC. I will have a look at the CDialogBar class. Is it
possible to create a dialog bar with any dialog template? Even
containing edits and such? Can I make a CDialogBar scrollable?

Thanks,
Stuart
0
DerTopper (96)
3/16/2006 8:44:52 AM
"Stuart Redmann" <DerTopper@web.de> wrote in message 
news:44192584.4ADB69AB@web.de...
> Tom Serface wrote:
>>
>> You could just use RUNTIME_CLASS() on the dialog class to put it in a 
>> view,
>> but I'm not sure this would solve your problem.
>>
>> You might want to put your toolbar code into the mainframe class or use
>> OnCmdMsg() to route the messages to all of the views.  Then you could 
>> just
>> us a CFormView for your dialog.
>
> This is quite an ugly workaround. Enabling and disabling toolbar command
> is the responsibility of a view, the mainframe should not be burdened
> with such tasks. Putting my dialog into a view won't do no good: I would
> get back the problems that I got before I tried to make the view to a
> dialog.
>
>
> "Scott McPhillips [MVP]" wrote:
>> If you really want a splitter, you probably should put a CFormView into
>> the splitter pane instead of a dialog.  A CFormView is a view that
>> displays a dialog template.  Using a CFormView will not disable the
>> toolbar buttons if you put the OnUpdate... handlers in CMainFrame.
>
> See above about putting the handlers in the main frame.
>
>>  From your description it sounds like you might not really want a
>> splitter.  You can simply create a modeless dialog independent of the
>> views (it would float above the view), or you can put the user controls
>> on a CDialogBar (a strip along some edge of the view), or you could put
>> them on a control pallette.  The MFC samples contains examples of all of
>> these approaches.
>
> I want a dialog that does not float, but sits on the left side of the
> frame window. One should be able to make it thinner (resize it
> horizontally), so a splitter bar would be perfect. The dialog should be
> able to scroll vertically, though.
>
> Here is my (ugly) workaround: I use a CScrollView instead of the dialog.
> This view has empty OnUpdate-handlers, so it won't mess with the tool
> bar. Any OnCommands from the tool bar are routed by hand to the view.
>
> I believe that this is quite unsophisticated. There should be a better
> way to do this in MFC. I will have a look at the CDialogBar class. Is it
> possible to create a dialog bar with any dialog template? Even
> containing edits and such? Can I make a CDialogBar scrollable?

The dialogbar does seem like a good candidate for you. You can use any 
controls on it, edit, labels etc. This is the whole point: it's like a 
button toolbar with more than just buttons. The problem is scrolling. You 
might be able to put a "scrollable" container on the dialog bar then put 
your contained controls in it.

>
> Thanks,
> Stuart 


0
kma3184 (100)
3/16/2006 10:44:35 AM
>>I want a dialog that does not float, but sits on the left side of the
>>frame window. One should be able to make it thinner (resize it
>>horizontally), so a splitter bar would be perfect. The dialog should be
>>able to scroll vertically, though.
>>
>>Here is my (ugly) workaround: I use a CScrollView instead of the dialog.
>>This view has empty OnUpdate-handlers, so it won't mess with the tool
>>bar. Any OnCommands from the tool bar are routed by hand to the view.
>>
>>I believe that this is quite unsophisticated. There should be a better
>>way to do this in MFC. I will have a look at the CDialogBar class. Is it
>>possible to create a dialog bar with any dialog template? Even
>>containing edits and such? Can I make a CDialogBar scrollable?

Wanting the dialog resizable and scrollable are two strong reasons to 
prefer CFormView in a splitter pane.  (Note that CFormView inherits from 
CScrollView: The scrolling will be automatic.)

For the toolbar OnUpdate issue you have your choice between the 
recommended ugly workaround and your own ugly workaround :(

The toolbar is a child of the mainframe and is created/resized by it, so 
I don't think that solution is ugly at all.  :)

-- 
Scott McPhillips [VC++ MVP]

0
Scott
3/16/2006 11:47:33 AM
Thanks to both of you,

Stuart
0
DerTopper (96)
3/16/2006 3:15:49 PM
OK, that's fair, but it does work.

If I need to do more than one view in a frame (like an Explorer type 
application) I tend to use the OnCmdMsg() routing idea.  The only caveat is 
that you wouldn't want the same Alt Keys, or toolbars used by multiple views 
since it could confuse them.

This article might be interesting to you:

http://www.codeproject.com/docview/splitcmdroute.asp

Tom

"Stuart Redmann" <DerTopper@web.de> wrote in message 
news:44192584.4ADB69AB@web.de...
>
> This is quite an ugly workaround. Enabling and disabling toolbar command
> is the responsibility of a view, the mainframe should not be burdened
> with such tasks. Putting my dialog into a view won't do no good: I would
> get back the problems that I got before I tried to make the view to a
> dialog.
>


0
tserface (3860)
3/16/2006 4:05:10 PM
Reply:

Similar Artilces:

Creating a field to search and enter non duplicate data
Hello all. I have a team of 15 pople that all work with reference numbers, on occasion a number has to be sent to a different work group. I've created a spreadsheet for them to enter the numbers into, but we have been duplicating numbers. I want to create a field to enter th number into, have the field cross reference the exsting numbers, and if it does not find a match, enter the number and sort the list. I know how to create a custom macro that will accomplish what I want to do, but I'd prefer a static formula if it's possible. A formula can not do waht y...

non
...

Query a non-MS/non-Active Directory LDAP Server
Hi All, Does anyone know how to query an LDAP server from Access VBA that is not a Microsoft / Active Directory (AD) server? I have found a lot of stuff about how to query AD and have succeeded in doing so. But that does not seem to transfer to the non-MS LDAP server. It gives the error "Automation error" "There is no such object on the server." Thanks, Clifford Bass -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/201004/1 Clifford Is there a chance that there...

HTTP radio button disabled on server type dialog box
I recently updated OL to OL 2002. I tried to setup my hotmail email account by going to Tools/email accounts/add new email account/Next. I wanted to select HTTP radio button on server type dialog but it is disabled. Can anybody please help? ...

Non Delivery Strangeness
I rebooted Exchange 2003 SP2 and received the following NonDelivery email on 1/3/2006 for an email sent on12/15/2005. I and other users received a few of these and the server seems to perform normally for the 100's of other emails that are sent and received daily. Thanks, Dan Foxley ---------------------- Your message did not reach some or all of the intended recipients. Subject: Purchasing From Your Site Sent: 12/19/2005 2:05 PM The following recipient(s) could not be reached: smartservice@smartwool.com on 1/3/2006 10:17 AM The e-mail system was unable to deliver the message, but d...

NON TAXABLE Item Setup, What TAX CODE to assign
What is the proper way to set up a non taxable item like a coupon or labor? I was assigning the <not assigned> (RMS dbase Tax ID 0) (But I just read said to delete the <not assigned> tax code. to prevent a runtime error (we have not had yet)) Do I need to setup a Non tax tax code? and add all non tax items to it? PS I have a < > (blank)(RMS Dbase tax id 3) tax code that seems to need to be deleted, RMS assigned it tax code 3. There are currently no items assigned to the < > blank tax id I can not find any guidance in the RMS Help. It seems MS ex...

NDR from non-existent email address
Any user that sends a meeting request to the user in question gets the following responce. Your message did not reach some or all of the intended recipients. I changed the info to the innocent. Subject: test Sent: 8/16/2005 9:01 AM The following recipient(s) could not be reached: Gay, Esse M. on 8/16/2005 9:02 AM The recipient name is not recognized The MTS-ID of the original message is: c=US;a= ;p=XXX;l=XXXXXXX-XXXXXXX MSEXCH:MSExchangeMTA:EXCHANGE:XXXXXX This only happens with meeting invites, regular email goes through just fine. It is jus...

Non-cash, Non-regular Transactions
Money 2003 SE V11 I have a need to set up transactions, such as Mileage, to keep track of non-cash activities. I currently handle it by setting up Bills & Deposits split into two transactions totalling $0.00. The first is the Category/Subcategory I want to track and the second is a Category/(Non-Cash Offset Subcategory) that I filter out of all reports. This works ok for me. Example: (meaning 23 miles traveled) Mileage:Medical/Dental 23.00 Mileage:Offset Non-cash Transaction -23.00 However, the transaction is not regularly occurring. Yet we are required to ...

mail from non exsiting user accounts
Hi, I have one exchange 2003 cluster server. and the email address configured as user@corp.ho.com. We are not using it for external mails. one of our IBM AIX user is able to send mails to anybody in my exchange server eventhough he is not having mail account in the windows 2003 domain. if u check the ID of the sender u will see that he is also using the same domain name ie @corp.ho.com... How can i stop others who do not having account in exchange to send mails to my domain. thanks BM Uncheck "Anonymous access" from SMTP virtual server properties | Access | Authentication and r...

Use of Dialog
Hi all, I'm curious about use of excel dialog. What is for? and how to use it and what other benefits or advantages in using for common financial worksheet? Thank you. :) -- markuss ------------------------------------------------------------------------ markuss's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=34966 View this thread: http://www.excelforum.com/showthread.php?threadid=553085 Dialogs can make things easier for you and your end user. They can be used to pre-validate entered information, apply business rules to it before placing it onto a w...

Pull Data From Non-Default Calendar
Hello, I am running Outlook 2003 and I have a macro that pulls data from the default calendar. I created a new calendar named "Instructor Schedule" which is a subfolder under Calendar. I would like to change the code so that the data is pulled from the new calendar. Currently I am using the following code. Set colCal = objNS.GetDefaultFolder(olFolderCalendar).Items What change would I need to implement to get my desired results? Thanks. Regards, Chris -- Regards, Chris Set colCal = objNS.GetDefaultFolder(olFolderCalendar).Folders.Item("Instructor Sch...

non project time
I am using MSP2007 for several projects en use a resource planning. The problem I have is that 1) the people have 8 hour working days but are not working 8 hours on the project. I can simply change the working time per person (it is different per group) but when I ad vacation as a task (next problem) MSP is not using the 8 hours but the adjusted time. This means that the vacation days are shorter than actual. 2) how can I use the non working time and make it visible in the Gantt Chard, like individual vacation and the non project time per day. 3) when adding vacation in the res...

finding last non empty cell in a column #3
FYI - The column could be any column not just B -- cparson ----------------------------------------------------------------------- cparsons's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1286 View this thread: http://www.excelforum.com/showthread.php?threadid=26238 ...

Insert Automatic, Non-Updating Date Stamp
I use an Excel invoice to bill clients. Currently I have an Invoice Date field which is populated by the =TODAY() function. That's good. However, if I open the spreadsheet down the road and accidentally recalculate, the Invoice Date field is updated with the current date. That's not so good. Is there a simple macro I can use that Inserts the date when the document is created and then terminates? Something, I guess, that calls the TODAY() function and then pops the resulting date value into the appropriate cell. I know I can just use CTRL+; to insert the date manually but I'm shoo...

Insert File dialog
Hi, I had this problem on Outlook 2002 - I've now upgraded to Outlook 2003 and it's still there... Whenever I try to attach a file and the 'Insert File' Dialog box opens, if you click on a folder to change directory (or on the drop-down box at the top) the whole thing hangs for 2-3 minutes before eventually changing to the folder or opening the drop-down. If you have a few folders to navigate to get to the file you want to attach it can take ages to get there! Any help/suggestions would be much appreciated. Oli. Make sure you do not have network mappings to shares...

Enable Non-Backorderable Items in POs (e.g. automatically cancel)
Enable identifying vendors and/or items to be non-backorderable from vendor. (e.g. automatically cancel non-received items) Many vendors do not backorder items. If an item is ordered and not shipped, it must be reordered. The current system requires the PO to be Edited so unreceived items are cancelled. This is an extra step and one if missed, is bad. For example, when an item is not received it remains in "released" status, which means the PO generator does not suggest a reorder. yet the vendor isn't going to ship. We face stock shortages and lost sales. In a busy environ...

non vba way to print non continuous ranges
Hi, Is there a non vba way to print non continous ranges on the one shee using excel? Specifically, lets say I want to print data from columns A, B, C, G an K down to row 35 in each column. Is there a way I can do that withou manually making them continuous by cutting and pasting each range ont a new sheet? Regards, David Obei -- DavidObei ----------------------------------------------------------------------- DavidObeid's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=223 View this thread: http://www.excelforum.com/showthread.php?threadid=27196 You can h...

Dialog Box controls/CListBox
I am having trouble accessing the contents of a list box after I close the dialog box. I want to find out what items are left in the box.. Am I not allowed to access the list box outside of the dialog box? If the dialogbox is destroyed, all its child controls are also destroyed. You should get the data out of the controls in OnOk or similar function. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "William Gower" <w_gower@hotmail.com> wrote in message news:uNdgmw3lDHA.1488@TK2MSFTNGP12.phx.gbl... | I am having trouble accessing the contents of a list box after I close t...

How do I count non blank rows only?
This seems so simple but I've spent hours without resolution. In column A, I need to count the number of rows that actually have data in them. If there is no data, I need to keep column A blank. Here's an oversimplied example of my simple list. 1 John Doe 2 Susan Smith 3 Joe Dear In column A now I have =COUNTA($B$2:B64) and that works great until you hit a row with no data. I have tried all these: =IF(G69>0,(=COUNTA($B$2:B69))," ") Also =COUNTIF($B$2:B69,">0") There's got to be an easy way that I'm missing!! HEEE...

Using english and non-English Excel commands simultaneously in a non-English installation
Hi community, I like this forum very much - I got many valuable insights from it. In the past I had an English Excel installation at the office available, recently my employer moved to the German version and deinstalled the english one. Now, when i use a english command like =VLOOKUP(A1,'Sheet 2'! A1:H200,8,FALSE) adopting the country settings for "," with ";" Excel comes up with #NAME? since I used the english term, not the german one - but sometimes the german equivalent is not at hand as fast as needed ;-) However if a open a english coined workbook of a US/UK c...

Options dialog box
I have a CPropertySheet based options dialog box which contains two tabbed pages (CPropertyPage) with Ok Cancel Apply buttons. My questions are two folds: 1. how do you add a support for the Apply button? Do you have to write a customized code for that or is there a canned code? 2. In some cases, the Cancel button doesn't work; if you change a value in the dialog, switch to another tab, click Cancel, the change you just made sticks when you go back. So is that something you have to write a logic for to handle the Cancel button correctly in a multi-tab dialog box? > Do you ha...

Non CRM Email Tracked
We used the Rules Deployment Wizard to add rules for all of our CRM Users. Today the CRM Admin email addresses received all emails that these users sent. They did not "Track in CRM" for these emails. There options are sent to track only emails with a CRM Tracking Token. Any idea why all emails are being tracked in CRM? We only want to track emails with the "Track in CRM" button selected. ...

How to make my app non-pagable
Hi, I'd like to make the app to be totally loaded into memory and never paged out (even partially) except program quit, it can be done by #pragma or compiler setting? Best Regards, Chandler In message <3C01E2BC-2BBE-4626-907A-990FED391BCA@microsoft.com>, Chandler <Chandler@discussions.microsoft.com> writes >I'd like to make the app to be totally loaded into memory and never paged out >(even partially) except program quit, it can be done by #pragma or compiler >setting? Flippant answer: Code it on a Commodore Vic-20 Serious answer: You cannot do this. Stephe...

display data for non zero
How do I get the follow if the raw data is available from the same spreadsheet but from a hidden column M, N if Hoursrepresent is not equal to value '0.00' using formula and NO Filter is used. A B couponID Hoursrepresent 00312 4.00 00315 2.50 00319 1.75 00323 3.60 M N couponID Hoursrepresent 00310 0.00 00311 0.00 00312 4.00 00313 0.00 00314 0.00 00315 2.50 00316 0.00 00317 ...

Non numeric axis vs non-numeric axis
I need to graph the months on y-axis and region names on x-axis and then plot a numeric value in the plot area. For some reason I cannot make it work. Any suggestions? Are you trying to make a table? Use the worksheet. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "windy_old_man" <windy_old_man@discussions.microsoft.com> wrote in message news:37259F1F-3A5B-4A78-B700-5556ABB227C2@microsoft.com... >I need to graph the months on y-axis and region names on x-axis and then >plot > a numeric value in th...