Page 2 of 2 <12
Topic Options
#92120 - 2003-06-02 08:23 PM Re: KiXForms Right Click
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ey Bryce,

Don't be foolish!

We will never forget (at least I won't) what you've done for us (me especially) long time ago when we (I) were (was) KiX Rookie(s) and you (and Shawn) the top poster around this board.

We love you all
[Big Grin]

[ 02. June 2003, 20:25: Message edited by: Jochen ]
_________________________



Top
#92121 - 2003-06-02 10:06 PM Re: KiXForms Right Click
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
I feel like I have been put out to pasture [Smile] 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. [Big Grin]

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 Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Chris... thanks for the font idea... man I had a blonde moment there [Wink] 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 = 400400
$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-220)
     $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
#92123 - 2003-06-03 07:55 AM Re: KiXForms Right Click
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Huh ? What ? Space padding ?

That's really old fashioned and Font dependant ...

Ummm... you didn't try my tiny sample above, did you ?

Oh hey, here is a practical sample :

Practical sample

Ummm, you might have to change the empty Icon from 49 to 59-64 in it [Wink]
_________________________



Top
#92124 - 2003-06-03 09:34 AM Re: KiXForms Right Click
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Jochen, did not see what you're talking about with the TINY SAMPLE, but I did like the PRACTICAL SAMPLE
Top
#92125 - 2003-06-03 01:44 PM Re: KiXForms Right Click
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Captain - was thinking maybe this would be the best option for removing the icon from a toolbutton ...

$ToolButton.Icon = -1

Thing is, this would totally remove the icon, plus the space taken up by the icon, so the Text would realign, which would be the expected behavior, no ?

-Shawn

[ 03. June 2003, 13:44: Message edited by: Shawn ]

Top
#92126 - 2003-06-03 02:38 PM Re: KiXForms Right Click
Chris S. Offline
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 Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Again my mind fooled me with false recalls ...

At the time it's like a very bad intelligence agency [Mad]

Sorry Guys [Frown]

Shawn, agreed.
_________________________



Top
Page 2 of 2 <12


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.059 seconds in which 0.026 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org