DesktopArea on the fly Thread last updated on 2003-04-05 06:50:41

Posted by member 7223 on 2003-04-04 07:00:10

Want to define desktoparea on the fly with only your mouse ?
Try this (jDesk and SkinBox needed):

*jDeskMButton1 [CTRL;!DesktopAreaDefine;!none]
*SkinBox DeskArea 0 0 8 8 #HLT



; ****************
; * DesktopArea *
; ****************



; !DesktopAreaDefine
; x, y, DAL, DAT modified


*Script Bang !DesktopAreaDefine
*Script Exec !VarSet x %{MouseX}
*Script Exec !VarSet y %{MouseY}
*Script Exec !VarSet DAL %{x}
*Script Exec !VarSet DAT %{y}
*Script Exec !SkinBoxMove DeskArea %{x} %{y} 8 8
*Script Exec !SkinBoxShow DeskArea true
*Script Exec !TimerAdd DeskArea #l 50 !DeskAreaUpdate
*Script Exec !TimerStart DeskArea
*Script Exec !SkinBoxAction DeskArea LButtonUp !DesktopAreaSet
*Script Exec !SkinBoxAction DeskArea RButtonUp !Execute [!TimerRemove DeskArea][!SkinBoxShow DeskArea false]
*Script ~Bang



; !DeskAreaUpdate
; X, y, w, h modified


*Script Bang !DeskAreaUpdate
*Script Exec !IfEval ("%{MouseX}" > "%{DAL}") '|VarSet w %{MouseX}' else '|Execute [!VarSet w %{DAL}][!VarSet x %{MouseX}]'
*Script Exec !IfEval ("%{MouseY}" > "%{DAT}") '|VarSet h %{MouseY}' else '|Execute [!VarSet h %{DAT}][!VarSet y %{MouseY}]'
*Script Exec !VarAdd w -%{x}
*Script Exec !VarAdd h -%{y}
*Script Exec !VarAdd w 1
*Script Exec !VarAdd h 1
*Script Exec !SkinBoxMove DeskArea %{x} %{y} %{w} %{h}
*Script ~Bang


; !DesktopAreaSet
; OUT:
; - %{DALeft}
; - %{DARight}
; - %{DATop}
; - %{DABottom}


*Script Bang !DesktopAreaSet
*Script Exec !TimerRemove DeskArea
*Script Exec !SkinBoxShow DeskArea false
*Script Exec !VarSet DALeft %{x}
*Script Exec !VarSet DATop %{y}
*Script Exec !VarSet DARight -$ResolutionX$
*Script Exec !VarSet DABottom -$ResolutionY$
*Script Exec !VarAdd DARight %{DALeft}
*Script Exec !VarAdd DARight %{w}
*Script Exec !VarAdd DABottom %{DATop}
*Script Exec !VarAdd DABottom %{h}
*Script Exec !jDeskSetWorkArea %{DALeft},%{DATop},%{DARight},%{DABottom}
*Script Exec !LogLabelAdd "Set DesktopArea to %{DALeft}, %{DATop}, %{DARight}, %{DABottom}"
*Script ~Bang


Then, just CTRL+LeftDown; define the desktoparea; release the button. It's done... and the desktoparea is save to the %{DA...} vars, too

Posted by member 7223 on 2003-04-04 07:02:42 link

Humm, the line
*Script Exec !LogLabelAdd "Set...
is not needed !

Posted by member 7223 on 2003-04-05 06:50:41 link

Here am I again...

just add these lines to the step.rc and your deskarea skinbox will look better:

DeskAreaColor raised D0D0D0 000000 000000
DeskAreaAlpha 128


I forgot to say: while defining desktoparea, RightClick to cancel...