73 lines
2.1 KiB
Plaintext
73 lines
2.1 KiB
Plaintext
--
|
|
-- demo\rosetta\Window_management.exw
|
|
--
|
|
include pGUI.e
|
|
|
|
Ihandle dlg
|
|
|
|
function doFull(Ihandle /*ih*/)
|
|
IupSetAttribute(dlg,"FULLSCREEN","YES")
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
function doMax(Ihandle /*ih*/)
|
|
IupSetAttribute(dlg,"PLACEMENT","MAXIMIZED")
|
|
-- this is a work-around to get the dialog minimised (on win platform)
|
|
IupSetAttribute(dlg,"VISIBLE","YES")
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
function doMin(Ihandle /*ih*/)
|
|
IupSetAttribute(dlg,"PLACEMENT","MINIMIZED")
|
|
-- this is a work-around to get the dialog minimised (on win platform)
|
|
IupSetAttribute(dlg,"VISIBLE","YES")
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
function doRestore(Ihandle /*ih*/)
|
|
IupSetAttribute(dlg,"OPACITY","255")
|
|
IupSetAttribute(dlg,"FULLSCREEN","NO")
|
|
IupSetAttribute(dlg,"PLACEMENT","NORMAL")
|
|
IupSetAttribute(dlg,"VISIBLE","YES")
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
function doDim(Ihandle /*ih*/)
|
|
IupSetAttribute(dlg,"OPACITY","60")
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
function doShow(Ihandle /*ih*/)
|
|
IupSetAttribute(dlg,"OPACITY","255")
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
function doMove(Ihandle /*ih*/)
|
|
integer {x,y} = IupGetIntInt(dlg,"SCREENPOSITION")
|
|
integer shift = iff(IupGetInt(NULL,"SHIFTKEY")?-10,+10)
|
|
IupShowXY(dlg,x+shift,y+shift)
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
procedure main()
|
|
IupOpen()
|
|
|
|
Ihandle hbox = IupHbox({IupButton("restore", Icallback("doRestore")),
|
|
IupButton("full screen",Icallback("doFull")),
|
|
IupButton("maximize", Icallback("doMax")),
|
|
IupButton("minimize", Icallback("doMin")),
|
|
IupButton("dim", Icallback("doDim")),
|
|
IupButton("show", Icallback("doShow")),
|
|
IupButton("move", Icallback("doMove"))})
|
|
IupSetAttribute(hbox,"MARGIN", "10x10")
|
|
IupSetAttribute(hbox,"PADDING", "5x5")
|
|
|
|
dlg = IupDialog(hbox)
|
|
IupSetAttribute(dlg,"OPACITY","255")
|
|
|
|
IupShowXY(dlg,IUP_CENTER,IUP_CENTER)
|
|
IupMainLoop()
|
|
IupClose()
|
|
end procedure
|
|
main()
|