workspace class

Provides a MDI workspace object
Inherits
object widget
Description
This widget provides a workspace window that can contain decorated window.
Functions
<object> $activeWindow()
Returns the active window, or 0 if no window is active.
<boolean> $scrollBarsEnabled()
Returns TRUE if the workspace provides scrollbars; otherwise returns FALSE.
$setscrollBarsEnabled(<bEnabled:boolean>)
Sets whether the workspace provides scrollbars to enable. (bEnabled 1 or 0)
$cascade()
Arranges all the child windows in a cascade pattern.
$tile()
Arranges all child windows in a tile pattern.
$closeActiveWindow()
Closes the child window that is currently active.
$closeAllWindows()
Closes all child windows.
$activateNextWindow()
Activates the next window in the child window chain.
$activatePrevWindow()
Activates the prev window in the child window chain.
|----CLASS EXAMPLE----|
|-Start:
#Let's start.
#We start the main class creation, in the constructor we do the
#widget's showing, to give a particular pop-up
#creation appearance.
class (ws,widget)
{
    constructor
    {
        $$->$setGeometry(%X,%Y,100,100)
        $$->%label=$new(label,$$)
        $$->%label->$settext("Another class by N\&G")
        $$->%label->$setautoresize(1)
        $$->$show()
    }
}
#We create the new workspace, and we set a 640x480 size with widget $resize
#command.
%Workspace=$new(workspace)
%Workspace->$resize(640,480)
#Now we make a cycling costruction of the widgets(look at the class),
#and give to the widgets a random X and Y coordinates.
#It takes few seconds to show the effects, be patient.
%I=0
while (%I<100)
{
    %X=$rand(500)
    %Y=$rand(480)
    %Widget=$new(ws,%Workspace)
    %I++
}
#Let's show the fireworks! EnJoY!
%Workspace->$show()
|-Start:
|-|EXAMPLE n2:
#This is like the first example but it has a particular animation effect.
%Hex[]=$array(0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
class (ws,widget)
{
    constructor
    {
     $$->$setGeometry(%X,%Y,100,100)
     $$->%lay=$new(layout,$$)
     %i=0
     while (%i<10)
        {
            $$->%label=$new(label,$$)
            $$->%label->$settext("Another class by N\&G")
            %color=%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]
            $$->%label->$setforegroundcolor(%color)
            $$->%label->$setautoresize(1)
            $$->%lay->$addwidget($$->%label,%i,0)
            %i++;
        }
        $$->$show()
    }
    mousepressevent
    {
        if ($istimer(cycle) == 1) killtimer cycle
    }
}
%Workspace=$new(workspace)
%Workspace->$resize(640,480)
%Workspace->$setCaption("Hit the mouse to stop cycling windows....")
%I=0
%Cicle=1
while (%I<20)
{
    %X=$rand(500)
    %Y=$rand(480)
    %Widget=$new(ws,%Workspace)
    %I++
}
%Workspace->$show
timer (cycle,3000)
{
    if (%Cicle==1) %Workspace->$tile()
    if (%Cicle==2)
    {
        %Workspace->$cascade()
        %Cicle=1
        return
    }
    %Cicle++
}
privateimpl(%Workspace,mousepressevent)
{
    if ($istimer(cycle) == 1) killtimer cycle
}
#-|End.

Index, Object Classes
KVIrc 3.9.99 Documentation
Generated by root at Wed Oct 17 19:34:06 2007