- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello all,
i am trying to build a program, based on sdi. but i have some problems with it. lets see;
1. how can i add a bitmap image onto a button. i have tried it before, but within sdi. loadimage function works fine. but i need it within a dialog app.
2. why cant i see icon on welcome dialog box when i run the program? and also on selection box?
3. i couldnt manage to close just an experiment dialog? at the same time i want to see an empty client area.
4. what should i do if i use dfwin statement? i think program doesnt work on a computer that hasnt visual fortran.
5. can i use excell to draw graphs on client window?(graph results are calculated by experiment dialogs)
6. what do you recommend me to do for that application? should i use a mdi instead? even if it is hard for me:)
any comment is appreciable...
thank you...
here is all code;
i am trying to build a program, based on sdi. but i have some problems with it. lets see;
1. how can i add a bitmap image onto a button. i have tried it before, but within sdi. loadimage function works fine. but i need it within a dialog app.
2. why cant i see icon on welcome dialog box when i run the program? and also on selection box?
3. i couldnt manage to close just an experiment dialog? at the same time i want to see an empty client area.
4. what should i do if i use dfwin statement? i think program doesnt work on a computer that hasnt visual fortran.
5. can i use excell to draw graphs on client window?(graph results are calculated by experiment dialogs)
6. what do you recommend me to do for that application? should i use a mdi instead? even if it is hard for me:)
any comment is appreciable...
thank you...
here is all code;
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
1. Button has to have BS_BITMAP or BS_ICON style ("Bitmap" or "Icon") in resource editor. Then, you have to Send(DlgItem)Message (BM_SETIMAGE) to it. Unfortunately, it cannot be easily combined with text (unless the text is drawn on the bitmap itself).
2. Icon is not assigned to dialogs automatically. You have to LoadImage(...IMAGE_ICON, 16, 16) and then SendMessage(hDlg, WM_SETICON, ICON_SMALL, hIcon)
3. What do you refer to as "experiment dialog"? Modeless dialogs should be destroyed using DestroyWindow, while modal ones should use EndDialog. You can use something like the following in WinMain:
4. USE DFWIN has nothing to do with it. What matters is what you have on Project/Settings/Fortran/Libraries. If there isn't a DLL version of run-time library, the program should work on another machine standalone. If there is a DLL version, you have to distribute DFORRT.dll as well.
5. You can't use Excel Graphs easily. You could insert a MS Graph ActiveX control (but that will work only with computers with Excel installed). I think other people here used to do it, but I don't know the details
6. SDI or MDI depends on whether several windows simultaneously are necessary. Judging on the purpose, I'd say MDI would be nicer, but that's for you to decide.
Jugoslav
1. Button has to have BS_BITMAP or BS_ICON style ("Bitmap" or "Icon") in resource editor. Then, you have to Send(DlgItem)Message (BM_SETIMAGE) to it. Unfortunately, it cannot be easily combined with text (unless the text is drawn on the bitmap itself).
2. Icon is not assigned to dialogs automatically. You have to LoadImage(...IMAGE_ICON, 16, 16) and then SendMessage(hDlg, WM_SETICON, ICON_SMALL, hIcon)
3. What do you refer to as "experiment dialog"? Modeless dialogs should be destroyed using DestroyWindow, while modal ones should use EndDialog. You can use something like the following in WinMain:
IF (DlgModal(IDD_WELCOME).EQ.ID_ENTER) THEN
DO WHILE (DlgModal(IDD_SELECTION).NE.IDCANCEL)
ghwndMain = CreateWindow(...)
DO WHILE (GetMessage(...))
...
END DO
END DO
END DOIn this way, you will always go back to IDD_SELECTION when the main window is closed. You should add an IDCANCEL button (it may be hidden) to IDD_SELECTION to provide closing.4. USE DFWIN has nothing to do with it. What matters is what you have on Project/Settings/Fortran/Libraries. If there isn't a DLL version of run-time library, the program should work on another machine standalone. If there is a DLL version, you have to distribute DFORRT.dll as well.
5. You can't use Excel Graphs easily. You could insert a MS Graph ActiveX control (but that will work only with computers with Excel installed). I think other people here used to do it, but I don't know the details
6. SDI or MDI depends on whether several windows simultaneously are necessary. Judging on the purpose, I'd say MDI would be nicer, but that's for you to decide.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...if you USE DFLOGM, 1) and 2), i.e. SendMessage will work only if you define a dialog-init callback and place the call there, i.e.
DlgSetSub(Dlg, IDD_SELECTION, OnDlgInit) ... SUBROUTINE OnDlgInit(Dlg, ID, iEvent) i = SendMessage(Dlg%hWnd, WM_SETICON...) i = SendDlgItemMessage(Dlg%hWnd, IDC_BUTTON1, BM_SETIMAGE...)Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
yesterday i changed the appearence! i decided to create a modeless dialog for each experiment dialog. meanwhile it means any calculations concerning with a given experiment. if there is a graph to be displayed i will use client area for it. and each time client area will be cleared. or i divide it into special areas.
well, i added buttons for user selection. so left IDD_SELECTION. may be i shouldnt. but now, tips doesnt appears yet! have to work some more...
by the way why modeless dialog boxes doesnt appear on the task bar? it doesnt have to. but if i use Modal dialog for Welcome and Modeless for Selection in WM_CREATE case (by DialogBoxParam) i cant see it on task bar.
thank you,Jugoslav.
yesterday i changed the appearence! i decided to create a modeless dialog for each experiment dialog. meanwhile it means any calculations concerning with a given experiment. if there is a graph to be displayed i will use client area for it. and each time client area will be cleared. or i divide it into special areas.
well, i added buttons for user selection. so left IDD_SELECTION. may be i shouldnt. but now, tips doesnt appears yet! have to work some more...
by the way why modeless dialog boxes doesnt appear on the task bar? it doesnt have to. but if i use Modal dialog for Welcome and Modeless for Selection in WM_CREATE case (by DialogBoxParam) i cant see it on task bar.
thank you,Jugoslav.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page