cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Fri May 17, 2013 9:46 pm Post subject: (QT-Like) Resizable Side panel example. |
|
|
5/18/2013 edit 12:27 AM
Resolved active titlebar issue. More advanced left button resize.
Resolved left pane side grab issue.
Code: | DIALOG CREATE,Parent,-1,0,517,313,RESIZABLE,class parent
dialog add,button,button1,0,0,100,20,Hello
REM *** Modified by Dialog Designer on 5/17/2013 - 15:06 ***
DIALOG CREATE,Child,-1,0,120,160,CLASS child,resizable
dialog add,button,button1,0,0,100,20,Hello
REM *** Modified by Dialog Designer on 5/17/2013 - 15:28 ***
DIALOG ADD,STYLE,STYLE1,,,,GRAY,
DIALOG ADD,TEXT,TEXT1,0,0,1000,1000,,,style1
# dialog show
%%k = @strdel(@winexists(#child),1,1)
LOADLIB user32.dll
%%knockout = @lib(user32,SetWindowLongA,INT:,%%k,-16,$40040000)
# %%knockout = @lib(user32,SetWindowLongA,INT:,%%k,-20,INT: $2000000)
%%tempvariable = @lib(user32,SetParent,INT:,%%k,@strdel(@winexists(#parent),1,1))
DIALOG CREATE,Child,-1,0,120,160,CLASS child2,resizable
dialog add,button,button1,0,0,100,20,Hello
REM *** Modified by Dialog Designer on 5/17/2013 - 15:28 ***
DIALOG ADD,STYLE,STYLE1,,,,GRAY,
DIALOG ADD,TEXT,TEXT1,0,0,1000,1000,,,style1
# dialog show
%%l = @strdel(@winexists(#child2),1,1)
rem LOADLIB user32.dll
# %%knockout = @lib(user32,SetWindowLongA,INT:,%%l,-16,$40000000)
%%knockout = @lib(user32,SetWindowLongA,INT:,%%l,-16,$40040000)
#b%%knockout = @lib(user32,SetWindowLongA,INT:,%%l,-20,INT: $2000000)
%%tempvariable = @lib(user32,SetParent,INT:,%%l,@strdel(@winexists(#parent),1,1))
dialog select,0
DIALOG SHOW
dialog select,2
DIALOG SHOW
dialog select,1
DIALOG SHOW
# %%knockout = @lib(user32,SetWindowLongA,INT:,%%k,-16,$40000000)
# %%knockout = @lib(user32,SetWindowLongA,INT:,%%l,-16,$40000000)
:evloop
wait event
parse "%%event;%%dialog",@event(d)
dialog select,%%dialog
goto %%event
:button1button
info %%dialog
goto evloop
:resize
if @greater(@winpos("%"%%k,w),30)
%%SetWindowPos = @lib(user32.dll,SetWindowPos,INT:,%%k,0,-10,-10,@winpos("%"%%k,w),@winpos(#parent,h),$0040)
else
%%SetWindowPos = @lib(user32.dll,SetWindowPos,INT:,%%k,0,-10,-10,35,@winpos(#parent,h),$0040)
end
%%SetWindowPos = @lib(user32.dll,SetWindowPos,INT:,%%l,0,@diff(@winpos(#parent,w),@winpos("%"%%l,w)),-10,@winpos("%"%%l,w),@winpos(#parent,h),$0040)
dialog select,0
dialog setpos,button1,10,@winpos("%"%%k,w)
dialog select,1
%%btn = @strdel(@winexists(~button1),1,1)
%%SetWindowPos = @lib(user32.dll,SetWindowPos,INT:,%%btn,0,@diff(@winpos("%"%%k,w),115),20,100,20,$0040)
# window position,@winexists(~button1),20,@diff(@winpos("%"%%k,w),100)
dialog select,2
dialog setpos,button1,20,0
goto evloop
:close
freelib user32
exit
|
|
|