- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a problem to place text and buttons on a registercard in a dialog with Visual Fortran 6.1. I created a new Dialog IDD_DIALOG1 and placed a registercard on it, IDC_TAB1. When I want to place text or buttons on that tab, they will be placed on the Dialog, not on the tab.
Can anybody help me?
cu,
OnkelHotte
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Message Edited by JugoslavDujic on 06-21-2004 05:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, now it works.
Now I have another problem :-) When I test the tabbed dialogs, I can use the tab-key to switch between the controls on that dialog. But when I start the program and press the tab-key, it only switches between OK and Cancel on the main dialog, not between the controls of the tabbed dialog. Is there a way to switch between the controls of the tabbed dialog and after them to the OK/Cancel button or is that not possible because they are on two different dialogs?
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's solved in my XFLOGM:
http://www.geocities.com/jdujic/fortran/xflogm/xflogmref.htm
(see pink text at the bottom of the page)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Markus, I received & replied to your e-mail, but your mail daemon looks more paranoid than Intel Premier Support >:):
[Denied content]
Profanity or Spam content were detected (Core)
So, for eventual reuse by other users, here it is:
| Your
| modifications helped me very much to implement the tab routines in my
| program. I just started here at this company and I never programmed Fortran
| before, so it is a little bit difficult for me to get used to it. But you
| helped me a lot, thank you very much for your help!
| With your module XFLOGM I can switch now between the controls on my tab
| dialog. Is it possible to go to the next edit control, when I press return
| in one edit control? At first, I had to disable to IDOK Button, because
| pressing return ended the dialog. But now the cursor remains on the edit
| field and will not go to the next, when I press enter. But switching with
| the tab key works great!
This used to be answered too on my home page, on "Win32 FAQ" page but now I saw I accidentaly deleted it when I was fighting FrontPage 2003 bugs...
grrr...
In short, you have to have a default button whose callback will automatically be pulled on Enter, so you can handle it. That means you should enable OK button, but remove "Default button" style from it. Then, create another button, e.g. IDC_DEFAULT, with "Default button" style, and make it hidden (not visible). Then, make a callback for it, e.g. OnDefaultButton(Dlg, Id, iEvent) -- note that it can be invoked only via Enter key, since it's hidden.
The callback should look like:
subroutine OnDefaultButton(Dlg, Id, iEvent)
use XFLOGM
use DFWIN
...
i = SendMessage(Dlg%hWnd, WM_NEXTDLGCTL, 0, 0)
end subroutine
WM_NEXTDLGCTL sets the focus to the next control in tab order.
To enable Shift+Enter for reverse operation, you should test value of Shift key:
if (GetKeyState(VK_SHIFT) < 0) then
i = SendMessage(Dlg%hWnd, WM_NEXTDLGCTL, 1, 0)
else
i = SendMessage(Dlg%hWnd, WM_NEXTDLGCTL, 0, 0)
end if
Jugoslav
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page