#92121 - 2003-06-02 10:06 PM
Re: KiXForms Right Click
|
Bryce
KiX Supporter
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
I feel like I have been put out to pasture I still use and write kix everyday, just don't have the time that I once did, or my own kix projects are worlds apart from the admin side of kix scripts. look here for an for an example.
I guess I am the Kixforms developer that is using the EXECUTE() command that Shawn was talking about.
There is something about building and executing whole chucks of code that will never see the saving graces of a .kix file that is just mind boggling....
I know I had a very good reason to use EXECUTE() when I made that function, but for the life of me I can't reacall what that was....
was it the dynamic size of the popup... it will come to me.... [ 02. June 2003, 22:08: Message edited by: Bryce ]
|
Top
|
|
|
|
#92122 - 2003-06-02 11:52 PM
Re: KiXForms Right Click
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
Chris... thanks for the font idea... man I had a blonde moment there I added a few lines to automatically make all the menuitems the same length, but with the font I was using kept changing the left alignment...
Here is the modification...
Break On $Form = CreateObject("Kixtart.Form") $Form.Size = 400, 400 $Form.Center $Form.ForeColor = Blue $Form.OnMouseDown = "OnFormMouseDown" $Form.Show WHILE $Form.Visible $=Execute($Form.DoEvents()) Loop Exit 1 FUNCTION OnFormMouseDown Dim $Menu,$Item $Menu = "New","Open","Save","Save as","Exit" $longestitem=0 For each $menuitem in $menu if len($menuitem)>$longestitem $longestitem=len($menuitem) endif next For $menucount=0 to ubound($menu) if len($menu[$menucount])<$longestitem do $menu[$menucount]=$menu[$menucount] + " " until len($menu[$menucount])=$longestitem endif next If $Form.MouseButton = 2 ; Right-click $Item = fnPopup($Menu,$Form.Left + $Form.MouseX, $Form.Top + $Form.MouseY) ?"Item=" $Item ENDIF EndFunction FUNCTION fnPopup($MenuStrings,$FormSLeft, $FormSTop) Dim $MenuItems[UBOUND($MenuStrings)] $FormS = CreateObject("Kixtart.Form") $FormS.BorderStyle = 0 $FormS.ClientWidth = 100 $FormS.ClientHeight = 42 $FormS.Top = $FormSTop + 30 $FormS.Left = $FormSLeft + 5 $Top = 1 For $i = 0 To UBOUND($MenuStrings) $MenuItems[$i] = $FormS.ToolButton($MenuStrings[$i], 1, $Top, $FormS.ClientWidth-2, 20) $MenuItems[$i].FontName = "Lucida Console" $MenuItems[$i].FlatStyle = 1 $MenuItems[$i].Alignment = 1 $MenuItems[$i].Icon = 60 $MenuItems[$i].HotBackColor = Navy $MenuItems[$i].HotForeColor = White $MenuItems[$i].OnClick = "$$FormS.Tag=$i $$FormS.Hide" $Top = $Top + 20 Next $FormS.ClientHeight = $Top + 2 $FormS.Line(0,0,0,$FormS.ClientHeight,"White") $FormS.Line(0,0,$FormS.ClientWidth,0,"White") $FormS.Line($FormS.ClientWidth-1,0,$FormS.ClientWidth-1,$FormS.ClientHeight,"DimGray") $FormS.Line(0,$FormS.ClientHeight-1,$FormS.ClientWidth,$FormS.ClientHeight-1,"DimGray") $FormS.Tag = -1
$FormS.Show While $FormS.Visible $=Execute($FormS.DoEvents()) Loop $fnPopup = $FormS.Tag ENDFUNCTION FUNCTION fnClickMe() $bFlip = not $bFlip If $bFlip $btnClose.Icon = 10 ; Green Check Else $btnClose.Icon = 9 ; Red X EndIf ENDFUNCTION
|
Top
|
|
|
|
#92126 - 2003-06-03 02:38 PM
Re: KiXForms Right Click
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
J, I did try your tiny sample and it didn't provide the desired effect, as demonstrated in this expanded tiny sample...
break on
$f = createobject("KiXtart.Form")
$a = $f.ToolButton("Left",$f.ClientWidth/2-40,$f.ClientHeight/2-10,80,20) $a.Icon = 60 $a.Alignment = 1
$b = $f.ToolButton("LeftAligned",$f.ClientWidth/2-40,$f.ClientHeight/2+10,80,20) $b.Icon = 60 $b.Alignment = 1
$f.Show
while $f.visible $ = execute($f.DoEvents) loop
|
Top
|
|
|
|
#92127 - 2003-06-05 07:46 AM
Re: KiXForms Right Click
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 918 anonymous users online.
|
|
|