|
Matt Gullett wrote:
My question is this: Do you think the averate user can figure out how to do this?
The ones that need it will. The ones that don't might complain about not being able to figure it out, but if you include a comprehensive set of pre-defined configurations, they should be alright. Just make sure the form editor isn't *annoying*, i.e., if you have buttons that jog field position, make them autorepeat if they're held down, allow drag&drop if it makes sense to do so, etc.
- Shog9 - Aaah... It's time to relax. You know what that means: a glass of beer, your favorite ergo chair... And of course, The Code Project loaded on your Personal Computer System. So go on, and indulge yourself, put your feet up. Lean back and just enjoy the articles. After all, CP sooths even the savage
|
|
|
|
|
You could have an advanced mode, which is turned off by default, that would let an advanced user modify more stuff (such as the positioning)
If you just want to experiment with UI stuff, then probably the best thing to do would be to knock together a simple prototype, and get assorted people to play with it, and give feedback
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hi,
I just wonder if I can use PThread (or any PThread class) in VC++. How about java and visual basic?
Thanks
|
|
|
|
|
Sorry, this is not an answer but a question : what´s a PThread ? ("You still have to learn a lot, young Padawan")
~RaGE();
|
|
|
|
|
You can find a Win32 pthreads library at http://sources.redhat.com/pthreads-win32/
|
|
|
|
|
The problem is that the dialog has not been created yet so you can't set its text, and SetWindowText isn't a member function of the CColorDialog class. It should be something like this:
CColorDialog clrDlg;
clrDlg.m_SomeMemberVariable.NameVariable = "Select Object Color";
clrDlg.DoModal();
-Raffi
|
|
|
|
|
Well, this is a rather common misundertanding about MFC dialogs and the underlying windows. When you construct a CColorDialog (or some other type of dialog, for that matter), it is only the MFC wrapper that gets created. It is in the middle of DoModal that the underlying HWND is actually created and attached to the MFC object. Unfortunately, after calling DoModal is all too late for setting the caption (the dialog has already exited.) The way out of this dilemma is as follows:- Create a class derived from
CColorDialog , say CMyColorDialog .
- Provide a constructor accepting the caption that stores it in some member variable defined to that purpose, say
m_caption .
- Add an
OnInitDialog handler and set there the new caption with SetWindowText(m_caption) .
Good luck!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to save some information in SYSTEM REGISTRY and then retrieve.
any one?
|
|
|
|
|
Why don't you use one of the classes available here at CP ?
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
More about me
|
|
|
|
|
You can use a registry class as Colin Davies suggested but if you want to directly use API, look up the following functions on MSDN
RegOpenKeyEx
RegCloseKey
RegEnumKeyEx
RegCreateKeyEx
RegDeleteKey
RegQueryValueEx
and
RegSetValueEx
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
How about the Old style WriteProfileString, WriteProfileInt and to retrieve use the GetProfileInt and GetProfileString. It works for me and it will work for you too. Make sure that in the App's InitInstance change the SetRegistryKey function if you don't want the stuffs to get saved in the "Local AppWizard.. Bla bla".
Sudip
Its QTime
|
|
|
|
|
Hi: I am trying to create a window using Microsoft, Visual C++ with MFC. I created the window with an “edit” box that is supposed to receive input from the keyboard. I also created a variable under the “edit” box IDC_BUTTON1 so that when I input data to the “edit” box, it can be transferred into the variable associated with the IDC_BUTTON1 and used in a C++ program. However, when I execute the program, nothing gets into the variable created. I am not sure of how I input data and transfer it to my C++ program. Any help will be appreciated.;P
|
|
|
|
|
in the handler for the button, call UpdateData(TRUE); this will load the data from the dialog into your variables, via the DDX calls that the class wizard has generated for you.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Thanks for your help Joaquín M López Muñoz. I have got the grid into the print dc. just have to resize
Desmond Mardle
|
|
|
|
|
I have been writing an application for an amatuer radio logbook. The application writes the entries into a grid which is displayed on the screen.
This works well the data is stored in an array and the grid is an Active X control. I am trying to write a print function for the app. The problem I have is transfering the grid to the on print routine. Can anyone tell me how to transfer the grid object to the OnPrint device context for printing.
Any help would be appreciated
Desmond Mardle
Des Mardle
|
|
|
|
|
I'm not sure whether this will work, but it might be worth giving a try: In your OnPrint handler, send a message WM_PAINT to the ActiveX control passing as argument the DC you were provided:
void OnPrint(CDC* pDC,CPrintInfo* pInfo)
{
m_grid.SendMessage(WM_PAINT,(WPARAM)(pDC->m_hDC));
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Well for the first query:
1) What you have done is right but in the wrong place. You probably have done it in App's InitInstance and after the DoModal() call. The correct place to do it is in the WM_SHOWWINDOW handler in the dialog class.. Just Override WM_SHOWWINDOW and type in ShowWindow(SW_MAXIMIZE).. its gonna work. You can also do it in the InitDialog handler.
2) Override the Oncalcel function in your derived Class. Make sure u don't call CDialog::OnCancel() in it.
Thats it
Sudip
|
|
|
|
|
When creating regions in GDI+ what is returned? Creating a region in the usual GDI returns a HRGN but what is returned in GDI+? A pointer? If so can I use that pointer stored in a struct for later use?
|
|
|
|
|
You get Region class instance which is wrapper for HRGN and works like MFC CRgn. You can work with it as with instance of any other class.
|
|
|
|
|
What is the diff. between GDI and GDI+?
|
|
|
|
|
GDI is the base graphical system that comes with Windows XP/2K/NT/ME etc.
If supports base drawing primatives and has limited image support.
GDI+ is shipped as a DLL which you can use in your application for 2K/NT/ME this must be shipped with your app. (~1.6mb). What you give is rich support for images, gradient brushes, text etc. etc. The programming model also simplifies the use of GDI:
EXAMPLE:
WCHAR string[] =
L"Draw text in a rectangle by passing a RectF to the DrawString method.";
FontFamily fontFamily(L"Arial");
Font font(&fontFamily, 12, FontStyleBold, UnitPoint);
RectF rectF(30.0f, 10.0f, 100.0f, 122.0f);
SolidBrush solidBrush(Color(255, 0, 0, 255));
graphics.DrawString(string, -1, &font, rectF, NULL, &solidBrush);
Pen pen(Color(255, 0, 0, 0));
graphics.DrawRectangle(&pen, rectF);
...
GDI+ is supported by .NET by default.
Normski. - Professional Windows Programmer
|
|
|
|
|
Thank you verymuch for your detailed response.
|
|
|
|
|
I like the GDI+ compared to GDI just for the image support alone. I still find it confusing since to me it seems you have to convert some things to GDI+. For example Rect to Crect when you use GetClientRect() or creating a bmp with CreateCompatibleBitmap() then using the HBITMAP handle for GDI+ Bitmap::FromHBITMAP(). Or am I missing something?
Other than that I love the new bush and image classes.
|
|
|
|
|
It's actually making sense to me now. The graphics object is associated with a dc then you can use that graphics object to draw, paint or what ever you can dream of. You can even have multiple graphics objects associated with a dc and each one is independent which I think is pretty cool.
I was trying to use multiple dc's associated with multiple graphics objects and wondering why each object I had was independent. LOL
It's just one big wrapper for GDI. Looks like MS is trying to integrate GDI+ more closely to DirectX.
|
|
|
|
|
Jay
If this makes you feel any better, I wrote my 2nd windows app. a tile puzzle game similar to the apple one. I tried to use a DC for each tile... No No No. any way a good way of learning Win32/GDI I still have the source code 'circa 93 maybe a good time to revamp and submit as a codeproject app.
Normski. - Professional Windows Programmer
|
|
|
|