KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Introducing: Outlook Bars!

 
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive
View previous topic :: View next topic  
Author Message
Ashmite
KiXforms Dabbler
KiXforms Dabbler


Joined: 27 Apr 2004
Posts: 13

PostPosted: Wed Apr 28, 2004 10:45 pm    Post subject: Introducing: Outlook Bars! Reply with quote

This was fun. Here's a sample of how to build Outlooks bars, those cool vertical sliding buttons first seen in Outlook. I'm working with Stevie (whenever he has spare beer in the fridge) to get this into a single Object so I can finish my tool to build these dynamically

For work, I have this working with real labels and sub-buttons in the sliding regions that actually work. It is the starting point for my Sys Admin Wizards tool set. I hope to have a fully functional tool set by the end of next week since I'm working at home this week and next.

Note: In my working version, the buttons are sitting in a Groupbox (soon to be a Panel. Thx Shawn!) and the Groupbox is what slides up and down, taking the main button and the sub buttons with it.

Enjoy!

--Ashmite

Code:


Break On
$System = CreateObject("Kixtart.System")


$Form           = $System.Form()
$Form.BackColor = 224,223,227
$Form.Height    = 443
$Form.Text      = "KiXforms Designer Template"
$Form.Width     = 367

$OutLookBar                   = $System.Object
$OutLookBar.Height            = 390
$OutLookBar.Width             = 100
$OutLookBar.Buttons           = $System.object
$OutLookBar.Buttons.Width    = 100
$OutLookBar.Buttons.Height    = 30
$OutLookBar.Buttons.Count     = 6
$OutLookBar.Slots             = $OutLookBar.Height / $OutLookBar.Buttons.Height
$OutLookBar.Control           = $Form.Controls.GroupBox()
$OutLookBar.Control.Height    = $OutLookBar.Height
$OutLookBar.Control.Width     = $OutLookBar.Width
$OutLookBar.Control.Top       = 10
$OutLookBar.Control.Left      = 60
$OutLookBar.Control.Text      = ""
$OutLookBar.Control.BackColor = 224,223,227


Global $OutLookButton[6]

For $x = 1 to 6

   $OutLookButton[$x]                 = $System.Object
   $OutLookButton[$x].Index           = $x
   $OutLookButton[$x].CurSlot         = $x
   $OutLookButton[$x].TopSlot         = $x
   $OutLookButton[$x].BotSlot         = $x + ( $OutLookBar.Slots - $OutLookBar.Buttons.Count ) 
   $OutLookButton[$x].Control         = $OutLookBar.Control.Controls.Button()
   $OutLookButton[$x].Control.Height  = $OutLookBar.Buttons.Height
   $OutLookButton[$x].Control.Left    = 0
   $OutLookButton[$x].Control.Text    = "Button" + $x
   $OutLookButton[$x].Control.Top     = ($x - 1 ) * $OutLookBar.Buttons.Height
   $OutLookButton[$x].Control.Width   = $OutLookBar.Buttons.Width
   $OutLookButton[$x].Control.OnClick = "OnButtonClick( $OutLookButton[$x].Index )"

Next

For $x = 2 to 6
   $OutLookButton[$x].CurSlot = $x + 7
   $OutLookButton[$x].Control.Top = ($x + 6 ) * $OutLookBar.Buttons.Height
Next




$Form.Show

While $Form.Visible
   $=Execute($Form.DoEvents())
Loop
Exit 1

Function OnButtonClick( $idx )

   If $idx <> 1
      If $OutLookButton[$idx].CurSlot = $OutLookButton[$idx].TopSlot
         For $x = $OutLookBar.Buttons.Count to $idx Step -1
            If $OutLookButton[$x].CurSlot = $OutLookButton[$x].TopSlot
               $OutLookButton[$x].Control.Top = ($OutLookButton[$x].BotSlot - 1 ) * $OutLookBar.Buttons.Height
               $OutLookButton[$x].CurSlot = $OutLookButton[$x].BotSlot
            EndIf
         Next
      Else
   
         For $x = 1 to $idx
            If $OutLookButton[$x].CurSlot = $OutLookButton[$x].BotSlot
               $OutLookButton[$x].Control.Top = ($OutLookButton[$x].TopSlot - 1 ) * $OutLookBar.Buttons.Height
               $OutLookButton[$x].CurSlot = $OutLookButton[$x].TopSlot
            EndIf
         Next
      EndIf
   EndIf
EndFunction

Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Apr 28, 2004 11:55 pm    Post subject: Reply with quote

This is truely what makes Kixforms so rewarding (for me anyways) - seeing wonderfully new and creative and stuff like this just knocks my socks off ... blows me away
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group