- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
!!!*** dlg % dirty = .true.
!!!*** dlg % list(i) % dirty = .true.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the edit box callback routine handles the edit box message by reading the contents (using DLGGET)and then updating it again, using DLGSET, then I have found this annoying thing to happen, what you type spreads out to the left from the cursor position. My work-around is to create an invisible button and make it the default button (only one control can be the default in a dialog box), so that when ENTER is pressed after ending your editing of the edit box contents, the default button's code is sent to its call-back routine (which can be the same as the edit box's call back) and it can be handled and the edit box contents can then be read and updated as you like. The edit box contents are then only updated when you press ENTER (so long asa you remove any DLGSET to the edit box when handling the edit box message in its call back routine). Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Am I missing the original post in this thread? I can only guess what the original problem was.
I think (without digging into code and without seeing the original post) that the problem is that SetWindowText/WM_SETTEXT for edit control places the cursor at the end of selection. If you do that in the middle of user's typing, that could certainly be annoying.
I think the workaround could be to place something like following into DLG_UPDATE/DLG_CHANGE callback:
i = DlgSendCtrlMessage(Dlg, IDC_EDIT1, EM_GETSEL, LOC(iStart), LOC(iEnd))
!Digest contents of edit box
i = DlgSet(Dlg, IDC_EDIT1, whatever)
i = DlgSendCtrlMessage(Dlg, IDC_EDIT1, EM_SETSEL, iStart, iEnd)
In this way, the caret should stay in the same position as it was before the user's typing.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Message Edited by MADsblionel on 11-29-2003 04:09 PM
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page