SkinBoxes Thread last updated on 2003-04-19 11:19:53

Posted by member 7223 on 2003-04-19 06:39:58

I don't know if there's some people who want to play with skinbox.
I've made some tests and nothing work like I wanted it to...
Then, the only thing I can give you is the working part of the whole stuff.

It's a set of scripts that make easy to make draggable and resible skinboxes.

What do you need:
- Create an empty "Null.rc" in "$ConfigDir$"
- create an evar called "UserEtc" that will point to "whateveryoulike"
- Create the folder "whateveryoulike"
- Create the following files in that folder: "step.mz", "boxes.rc", and "gfx.rc" that should contain this:
;
; Gfx.rc
;


; Images edges not affected by stretch/tile
BoxEdgeTop 30
BoxEdgeLeft 7
BoxEdgeRight 7
BoxEdgeBottom 8


; Default size of new boxes
BoxDefaultWidth 80
BoxDefaultHeight $BoxEdgeTop+BoxEdgeBottom$


BoxTitleX 7
BoxTitleY 5
BoxTitleFont Arial
BoxTitleFontColor A0A0A0
BoxTitleFontBold true
BoxTitleFontHeight 14


- Add this to your step.rc:
LoadModule "$Modules$Timer.dll"
LoadModule "$Modules$SkinBox.dll"
LoadModule "$Modules$Label.dll"
LoadModule "$Modules$FileMaster.dll"
LoadModule "$Modules$TextEdit2.dll"

Include "$UserEtc$Gfx.rc"
Include "$UserEtc$Boxes.rc"

*mzScriptFile "$UserEtc$Step.mz"

; LeftUp set the last focused skinbox on bottom
*jDeskMButton1 [.none;!none;!IFNeq CurrentBox ".none" |Execute [!SkinBoxOnTop %{CurrentBox}][!VarSet CurrentBox .none]]

*Timer BoxMove #l 40 '!Execute [!Exec !SkinBoxExec %{CurrentBox} !VarSet x ^@mxd^][!Exec !SkinBoxExec %{CurrentBox} !VarSet y ^@myd^][!Exec !VarAdd x %{dx}][!Exec !VarAdd y %{dy}][!Exec !IfEval ("%{x}" "0") |VarSet dx 1
*Script Exec !IfEval ("%{y}" > "0") |VarSet dy 1
*Script Exec !VarMul dx %{dy}
*Script GotoIf ("%{dx}" > "0") BoxResize

*Script Exec !SkinBoxExec %{CurrentBox} !VarSet dx ^@ixd^
*Script Exec !SkinBoxExec %{CurrentBox} !VarAdd dx -^@mxd^
*Script Exec !SkinBoxExec %{CurrentBox} !VarSet dy ^@iyd^
*Script Exec !SkinBoxExec %{CurrentBox} !VarAdd dy -^@myd^
*Script Exec !TimerStart BoxMove
*Script Exit

*Script Label BoxResize
*Script Exec !SkinBoxExec %{CurrentBox} !VarSet dx ^@isx^
*Script Exec !SkinBoxExec %{CurrentBox} !VarSet dy ^@isy^
*Script Exec !SkinBoxExec %{CurrentBox} !VarAdd dx -^@mx^
*Script Exec !SkinBoxExec %{CurrentBox} !VarAdd dy -^@my^
*Script Exec !TimerStart BoxResize
*Script ~Bang



*Script Bang !BoxLButtonUp
*Script Exec !TimerKill BoxMove
*Script Exec !TimerKill BoxResize
*Script ~Bang



*Script Bang !BoxResize
*Script Exec !SkinBoxSize %{\1} %{\2} %{\3}
*Script Exec !VarAdd \2 -$BoxEdgeRight+BoxTitleX$
*Script Exec !%{\1}TitleLabelResize %{\2} $BoxTitleFontHeight$
*Script ~Bang



*Script Bang !BoxRemember
*Script Exec !TextReplace @$UserEtc$%{\1}.rc@ @^%{\1}BoxX @ @&%{\2}@
*Script Exec !TextReplace @$UserEtc$%{\1}.rc@ @^%{\1}BoxY @ @&%{\3}@
*Script Exec !TextReplace @$UserEtc$%{\1}.rc@ @^%{\1}BoxWidth @ @&%{\4}@
*Script Exec !TextReplace @$UserEtc$%{\1}.rc@ @^%{\1}BoxHeight @ @&%{\5}@
*Script ~Bang



*Script Start !VarSet CurrentBox .none




How it works:
- Just call !BoxNew SingleWordBoxName to create a new box. It should appear at mouse pos.
- The file "SingleWordBoxName.rc" is create in "$UserEtc$". It contain the X, Y, Width and Eight of the box. At the beginig, it was intend to contain more stuff...
- A line 'Include "$UserEtc$SingleWordBoxName.rc"' is add to "boxes.rc".
- A line '*Script Start !BoxCreate SingleWordBoxName' is add to "step.mz".
- Move your box around and resize it by LeftClicking in the right bottom edge.
- RightClick on the box and select to destroy to destroy the box and remove all the stuff previously generate.

Note: sometimes, boxes position and size isn't reccord on !recycle. To avoid this, just !UnloadModule "$Modules$Skinbox.dll" before !recycle.

Hope this will be usefull...

Posted by member 7223 on 2003-04-19 06:46:31 link

DeViLbOi: there's something wrong in your [edit] function. There's some part missing...

It seems that the symbol "less than" isn't supported in this forum

Humm, I have to post the theme...
Can be found here: http://www.litestep.net/index.php?section=2&action=details&id=121

Posted by member 1 on 2003-04-19 11:19:53 link

We are aware of it...it caught us admins once already. :)