Popup dialog controls in doc/view app

Hi,

I'm working on a text editor project using RichEditCtrl as my starting
point.

I want to be able to programatically (like on a WM_LBUTTONDOWN or
something)  create things like combo boxes, rich edit controls, etc.
and so far haven't had much joy.

Should I be able to use the Create method to achieve the desired
effect? In my project I have the files that have been generated by
Visual Studio and I was thinking that I might have to declare a
variable:

myProjectView.h
----------------
CRichEditCtrl m_myRichEdit;

and then create it:

myProjectView.cpp
------------------
m_myRichEdit.Create(.........);

Am I thinking along the right lines? How do I get rid of it
afterwards? Destroy()?

Regards,

Adrian.
0
7/2/2003 12:37:38 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
912 Views

Similar Articles

[PageSpeed] 25

It is not clear why creating the rich edit control dynamically is going to do any good,
since you are starting with one (presumably in a CRichEditView). And when you say "create
combo boxes, rich edit controls, etc." we're left guessing as to what you are trying to do
(for example, given you already have a rich edit control, what is another one going to do?
Where would it appear? Why would it appear? What is its function?) Likewise for combo
boxes. Without knowing what you are trying to do, it is hard to suggest what might be the
appropriate solution. Tell us a bit more about what is going on.
					joe

On 2 Jul 2003 05:37:38 -0700, adriangibbons@yahoo.co.uk (Adrian Gibbons) wrote:

>Hi,
>
>I'm working on a text editor project using RichEditCtrl as my starting
>point.
>
>I want to be able to programatically (like on a WM_LBUTTONDOWN or
>something)  create things like combo boxes, rich edit controls, etc.
>and so far haven't had much joy.
>
>Should I be able to use the Create method to achieve the desired
>effect? In my project I have the files that have been generated by
>Visual Studio and I was thinking that I might have to declare a
>variable:
>
>myProjectView.h
>----------------
>CRichEditCtrl m_myRichEdit;
>
>and then create it:
>
>myProjectView.cpp
>------------------
>m_myRichEdit.Create(.........);
>
>Am I thinking along the right lines? How do I get rid of it
>afterwards? Destroy()?
>
>Regards,
>
>Adrian.

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
7/2/2003 1:44:34 PM
I think I mentioned that I am working on a text editor. Its for a
scripting language that I use regularly and I want to copy some of the
functionality of Visual Studio. I have colour syntax highlighting for
keywords (hence the editor is rich text), auto identation of the code
and brace pair matching (nearly!).

I would also really like something similar to that is VS so that as
you type a function:

myFunction(

Something pops up and reminds you of the parameters that it takes:

           |int a, char b, ...|
myFunction(

maybe even making the current parameter that you're typing *bold* (but
that's not important).

I was thinking that a popup rich edit control would be quite nice as I
could set the colour of the background and the text, (and perhaps make
it bold). I would disable the popup control so that the user wouldn't
be able to type into it.

A tooltip might be another possibility but I'm not sure if you can
make these appear programatically.

I can make a rich edit control appear in a different project
dynamically when using CEditView, but can not with CRichEditView.

Any help would be much appreciated, apologies for not explaining what
I was doing more clearly before but I try to keep my posts brief or
people don't bother reading them!

Regards,

Adrian.
0
7/3/2003 7:32:32 AM
Adrian Gibbons wrote:
> 
> I think I mentioned that I am working on a text editor. Its for a
> scripting language that I use regularly and I want to copy some of the
> functionality of Visual Studio. I have colour syntax highlighting for
> keywords (hence the editor is rich text), auto identation of the code
> and brace pair matching (nearly!).
> 
> I would also really like something similar to that is VS so that as
> you type a function:
> 
> myFunction(
> 
> Something pops up and reminds you of the parameters that it takes:
> 
>            |int a, char b, ...|
> myFunction(
> 
> maybe even making the current parameter that you're typing *bold* (but
> that's not important).
> 
> I was thinking that a popup rich edit control would be quite nice as I
> could set the colour of the background and the text, (and perhaps make
> it bold). I would disable the popup control so that the user wouldn't
> be able to type into it.
> 
> A tooltip might be another possibility but I'm not sure if you can
> make these appear programatically.
> 
> I can make a rich edit control appear in a different project
> dynamically when using CEditView, but can not with CRichEditView.
> 
> Any help would be much appreciated, apologies for not explaining what
> I was doing more clearly before but I try to keep my posts brief or
> people don't bother reading them!
> 
> Regards,
> 
> Adrian.

It can be done with a tooltip, or with a CRichEdit, or with a CWnd (i.e.
painting your own tooltip).  You can find several examples at:

http://codeguru.earthweb.com/
http://www.codeproject.com/

--
Scott McPhillips [VC++ MVP]
0
scottmcp (342)
7/3/2003 9:18:07 AM
Adrian Gibbons wrote:

>I agree, a rich edit control is an overkill, can you please kick me in
>the right direction of copying intellisense? How should I go about it?

See if you can crib some things from this:

http://www.scintilla.org/

-- 
Doug Harrison
Microsoft MVP - Visual C++
0
dsh (2498)
7/7/2003 4:39:46 PM
Reply:

Similar Artilces:

Viewing Built-in Code
Greetings: How do I view the code for a built-in macro? Specifically, I want to see the code for "next sheet" and "previous sheet" (Crtl-PageUp & Ctrl-PageDown Thanks in advance for your help. -- Barry Carroll (Cleverly disguised as a responsible adult) --------- PSC Scanning, Inc. assumes no responsibility whatsoever for any statements made by me. I''m entirely on my own. If you are asking to view Excel's built-in commands code, you are out of luck. Those are not macros, but written in whatever programming language the developers use. Gord Dib...

password popup
HI, I'm using Outlook 2002 and every time i open it password window pops up. I tried everything. I changed my password with ISP, i went to the settings and verified name,password and every imaginable combination i could think of. i even went to security settings and set my privacy to low and i still get the same password pop up.Any help would be appreciated. Thanks Check you connection settings. Are they set to manual? If so, it will prompt you for your password. Check under tools email accounts and be sure the connection type is set to automatic Vickie >-----Original Messa...

Handling Popup Menu Commands in Parent ?
Hi guys, I have a CWnd-derived child window that has a popup menu (when you right click), I want to handle some (not all) of those menu commands in the parent. I can get the parent to handle them by using GetParent() in TrackPopupMenu() but then the child can't handle any. If it's a big pain I can handle them all in either the child or the parent but maybe it's pretty easy to do ? Thanks. R. I did it like this: // My Cwnd-derived custom view BOOL CLayoutView::OnCmdMsg(UINT nID,int nCode,void* pExtra,AFX_CMDHANDLERINFO* pHandlerInfo) { // let child have first crack at ...

How To: copy dialogs from one project to another ?
Do you know how to copy a dialog used in one project to a new project, can I do this from outside IDE just copy files from one directory to another ? or do I need to copy manually inside IDE. Thanks in advance for your help, Eduardo Tom Serface wrote: > > don't mess up the original. I do this all the time and it works really > well. Do you do it with VS .NET 2003? If you do, great, because it just means my installation is broken in some way. If you don't, I suspect that if you migrate to .NET 2003, you'll swear at it and stamp your foot as much as I did when I fo...

viewing a shared calendars
With Exchange/Outlook 2003, is it possible to combine events from multiple calendars and view them on one calendar? In other words, if two coworkers have shared their calendars and authorized me to see them. Instead of popping a separate window for their calendars, can I view their events on the same calendar as my own? Thanks, Jeff Not as far as I know. But in Outlook 2003 you can view other users' calendars side-by-side in the same window which is pretty darn neat if you ask me. :) -- Neil Hobson Exchange MVP For Exchange news, links, and tips, check: http://www.msexchan...

Paint problem with child dialogs and tab control
Hi, I have a main dialog that has a tab control. For each tab, I have a child dialog. The problem is that the tab control's color isn't solid (with XP styles), so if I use COLOR_WINDOW for the child window, it will not take the gradient pattern of the tab control. How can I manage to make this work? Thanks! :) U�ytkownik "Luc" <l_vandal@hotmail.com> napisa� w wiadomo�ci news:yKEnb.2971$Nm6.194226@news20.bellglobal.com... > Hi, > > I have a main dialog that has a tab control. For each tab, I have a child > dialog. The problem is that the tab control...

File Dialog in access 2007 01-11-10
Im having problems with the following code in access 2007. I'm trying to open a file dialog to place an image into a form. Any help would be appreciated Reghards Rob. Sub getFileName() ' Displays the Office File Open dialog to choose a file name ' for the current id record. If the user selects a file ' display it in the image control. Dim fileName As String Dim result As Integer With Application.FileDialog(MsoFileDialogOpen) .Title = "Select Picture" .AllowMultiSelect = False .Filters.Clear...

GetWindowRect on Embedded Dialog
I have a main dialog and an embedded dialog whose parent is a frame on the main dialog. I have a simple tree view control on the embedded dialog. When I do a GetWindowRect( &rect ) on the tree control, I get the rect of the control in reference to the MAIN dialog and I use the "Top" and "Left" values so I can resize the control in proportion to the frame on the main dialog while leaving the top and left position the same. Here is my question: When I do SetWindowPos(x,x,x,x,SWP_SHOWWINDOW) on the tree control, it appears to use the "Top" and "Left"...

How to support clickable URL in the balloon popup from systray icon
Hi, I am working on a project which creates a sys tray icon and occasioanlly pop up ballooon message. The project is in VC++. As per our product requirement, this pop up should support clickable URLs as well, to which I am facing difficulty. I tried adding href tags to the URL, but it is showing up as plain text. Is there any way by which I can support this feature. It would be of great help, if anyone can suggest me a solution to this. Thanks in advance, Anu You will have to display the balloon yourself. Here is a an example that does have link capabilities built-in http://www.codeprojec...

Popup required
For a longish macro (made up of a few smaller macros), what is a simple way of displaying a message box saying "operation in progress, etc", and then when the macro has finished, another message box with an OK button saying "operation completed"? For the first requirement, just create a UserForm with the appropriate message on it (I use one called 'frmWaitMsg' that just says "Building Document - Please wait...") and make sure its ShowModal property is set to false. This will allow code to run while the UserForm is displayed. Show the f...

Control to draw
Hi, I am trying to find the way to use some drawing tool in ms access. My project is to bring template image from file and then draw couple check marks on it and save as new image to db, template should not be altered. Any ideas ? ...

I keep getting dialog box is open error in Word 2003.
Everytime I go into MS Word I get an error that says my dialog box is open. I have to click ok then I can go in. How can I get rid of this error? Disable the Office Plug-in option in Norton Antivirus (or other AV that you may be using). -- Terry Farrell - MSWord MVP "Tracey F" <Tracey F@discussions.microsoft.com> wrote in message news:01911FF2-10AB-43A6-9BBB-4E630A886D38@microsoft.com... > Everytime I go into MS Word I get an error that says my dialog box is > open. > I have to click ok then I can go in. How can I get rid of this error? ...

Summing Calculated Control
Although I have read the posts on this, I still can't get it to work. I have put the following code into the subform control's record source: HoursAndMinutes([DepartTime]-[ArriveTime]). The "HoursAndMinutes" is code in the module. It converts the time to hours and minutes. This works on the form. I need to sum this in the forms header and multiply it times the billing rate. I have tried: =Sum(HoursAndMinutes([DepartTime]-[ArriveTime]))*[BillingRate]. What do I need to do? Thanks Ron, If you are on the parent form and want to know the value of a control on the subform...

Progress Dialog, Worker Thread Problem
Hi, In my Document I have a lengthy process, which I try to run in a worker thread, with a modal dialog box showing progress. Like this: void CFDocument::OnExportXXX() { if( m_cExportXXXDialog.DoModal() == IDOK ){ m_bExporting = TRUE; THREADPARMS* ptp = new THREADPARMS; ptp->pMainFrame = (CMainFrame*)AfxGetMainWnd(); ptp->pDoc = this; ptp->pProgCtrl = &(m_cProgressDialog.m_ctlProgress); AfxBeginThread(RunExportXXX, ptp); m_cProgressDialog.m_sProgressText = "Exporting to XXX..."; m_cProgressDialog.DoModal(); } } UINT RunExportXX...

SDI with multiple views using the wizard
Hi all, I would like to build a Doc/View SDI Visual C++6 project using multiple views as (CFrameWnd) for the same document. In some documentation is mentioned just MDI support multiple views. Could someone please explain the steps for doing that, using the wizard? Thank you, Chris ...

popup
The following shutdown script calls up an .hta correctly. Then the script correctly pops a requester in front of the .hta seeking a response, or will time out. The second popup resulting from timing out or the user interacting, pops UNDER the .hta instead of in front. I want that second popup in front. Help? =-=-=-=-=-=-=-=-=-=- begin .vbs =-=-=-=-=-=-=-=-=-=- Option Explicit Const gcVERBOSE = FALSE ' ### TRUE for testing Dim objShell Set objShell = Wscript.CreateObject( "Wscript.Shell" ) Sub sTerminate( strReason ) If gcVERBOSE Then Wscript.Echo no...

Drawing static/edit control in different colors
Hi All, This should be a simple question, but it is possible to, control the color of text written to static text or an edit box? I need to do this at during InitDialog and while dialog is 'up' (DoModal). As an aside, can change the color of static text just based on the resource ID? i.e. not creating a variable for the control in the dialog class. Thanks in Advance! Corey. Corey Wirun wrote: > Hi All, > > This should be a simple question, but it is possible to, control the color > of text written to static text or an edit box? I need to do this at during > In...

Dialog-Editor Control zur�ckholen
Hallo NG, ich hab ausversehen meinen Edit Control in der Toolbar im Dialog-Editor gel�scht. Jetzt krieg ich ihn nicht wieder. Rechte Maustaste->Men�punkt "Elemente hinzuf�gen" hilft mir leider nicht weiter, da passiert nichts, wenn ich dann was ausw�hle. Wie krieg ich meinen Edit Control wieder? Danke f�r Hilfe, Guido Franzke > ich hab ausversehen meinen Edit Control in der Toolbar im Dialog-Editor > gel=F6scht. Jetzt krieg ich ihn nicht wieder. Rechte Maustaste->Men=FCpun= kt > "Elemente hinzuf=FCgen" hilft mir leider nicht weiter, da passiert nichts, &...

Implementing 3-Tabs to Existing Dialog Project
I have an application (MFC dialog type) that needs to be modified. The current app provides the customer a type of "Test" to be performed. As part of an Add-On, I want to add a 3-tab control (CPropertySheet & CPropertyPage) where the existing "Test 1" is done on tab 1. Then I will add a "Test 2" & "Test 3" on Tab 2 and Tab 3. The user can choose which "Test" to do based on selecting the proper Tab. I created the CMyPropertySheet along with the 3-Tabs (CTab1, CTab2, CTab3). The problem is this. Right now the 3-tab di...

A2002: How do I get rid of "life" subforms/subreports in design view?
I have upgraded from A97 to A2002 recently. There are some new features which really drive me crazy. "Live" subforms/subreports is one of these new features. Is there any option to make all my subforms/subreports to behave as in A97? I have experienced (maybe two or three times) that subforms were OK (ie. A97 behaviour) when I opened a form. But it doesn't happen very often. (I have a Czech version of A2002.) See http://www.trigeminal.com/lang/1033/utility.asp?ItemID=5#5. It's for A2000 only... ;-( In news:OOCK6sqYHHA.4988@TK2MSFTNGP03.phx.gbl, Vladim�r Cvajniga <...

MDI Doc/View
I have an MFC MDI Doc/View Application, using only one document type, but with different views. That is working fine. The way I do it now is to define a separate menu for all views in the resource editor. That's fine (apart from some copy & paste) for most menus but when I add a new menu entry at runtime it only get's connected to the active view. Is it best to: a) add the new entry in a loop for all viewtypes? And if so, what when you need to update the runtime-entries? b) share only one menu between the views? And if so, how do you do that? And if you do that, will a new menu ...

adding a date popup box
Hi, is it possible: instead of writing a date manualy in a cell, to open combo box (pop up) and choose the date ? can i do that in excel ? -- Message posted from http://www.ExcelForum.com Hi see: http://www.rondebruin.nl/calendar.htm -- Regards Frank Kabel Frankfurt, Germany > Hi, > > is it possible: instead of writing a date manualy in a cell, to open a > combo box (pop up) and choose the date ? can i do that in excel ?? > > > --- > Message posted from http://www.ExcelForum.com/ Frank, I've used your website in the past & it is extremely helpful. Ho...

Access 2000 Controls Wizard Not Working...
Hi all, I am currently trying to learn to use access 2000 to create simple databases. Unfortunately the Control Wizard has stopped working and I am unable to get it working again. I have clicked the Control Wizard button on the tool bar, but when I place a control (button, combo box, etc. etc.) it does not come up with the wizard screen. It just places the control object onto the form. I have tried uninstalling and reinstalling bu the problem persists. I am using Windows XP (SP3) and Office 2000. Hi Rob, > I am using Windows XP (SP3) and Office 2000. First, make su...

Is there an option to view Special (control) Characters in Excel 2
I constantly import files into Excel 2007 (from CSV or Access files) and oten there are carriage returns hiddin within the data. Is there an option in Word 2007 that I can turn on so I can see the special (control) characters? There was an option in Word 2003 under Tools, and under the International Tab. I can't seem to find any options that will display control characters. I don't need to identify each control character - I'm just looking for a view that will display the small boxes denoting control characters. Any help would be appreciated. My apologies - I meant i...

I am missing view tool bar from tool menu.
Try using Tools>Customize... select the 'worksheet menu bar' and press 'reset' -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "excel" <excel@discussions.microsoft.com> wrote in message news:E2063A32-A143-443B-8DCD-7F66A3ED666C@microsoft.com... > ...