Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29273 Discussions

How can I make "DlgSetSub" take effect without using "DlgModal(XDlg)"

lyricx
Beginner
789 Views
When using DlgSetSub to draw on a Owner Draw button, I use:

DlgSetSub(XDlg, ID_OnDraw, XWnd_OnDraw, DLG_DRAWITEM)

but it have take effect once I use a DlgModal(XDlg), but I want to
this drawing can be realised without DlgModal(XDlg) following behind, how can I do this?

Or we can ask how to draw on a Owner Draw button repeatedly once a dialog is initialized?



0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
789 Views
I don't quite follow you. Why would you draw on something which isn't displayed? The drawing callback is invoked whenever the button needs to be (re)displayed, and it will never take place if the dialog is not shown.

Do you need some sort of animation? In this case, you have to ensure that the button gets continuously redrawn by doing an InvalidateRect or XUpdateWindow, but calling it from an external routine, such as a WM_TIMER callback. In the DLG_DRAWITEM callback, just make sure to draw accordingly, based on some sort of (global) time variable. See the old XFLOGM sample for an example.
0 Kudos
lyricx
Beginner
789 Views
basically done with XFLOGM, Thank you very much!
0 Kudos
Reply