Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Larger Custom Dialog at Design Time
#3
This function scrolls the client area of the dialog in the Dialog Editor when you drag it with the middle mouse button.
Create new function, paste this code, and paste the trigger string in the Trigger field above macros. The function will run automatically when need.
Function dialog_editor_scroll
Trigger !ca"Dialog Editor" "QM_DE_class"     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=TriggerWindow
if(!hwnd) hwnd=win("Dialog Editor" "QM_DE_class")
int c=child("" "#32770" hwnd 0x0 "style=0x8000000 0x8000000")
POINT p pp; int mbPressed
rep
,0.05
,if(hwnd!=win) if(IsWindow(hwnd)) continue; else ret
,ifk- (4); mbPressed=0; continue
,xm p
,if !mbPressed
,,mbPressed=1
,else
,,if(!memcmp(&p &pp sizeof(p))) continue
,,ScrollWindowEx(c p.x-pp.x p.y-pp.y 0 0 0 0 SW_SCROLLCHILDREN)
,,InvalidateRect c 0 1
,pp=p
It is not perfect:
When saving, saves the current scrolled position. To save normal position, before saving need to scroll (middle-drag) back to the normal position, and click Save (Apply in old versions).
Ignores grid.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)