Difference between revisions of "TBCanvas"

From Jeremie Leroy - XOJO Controls Wiki
Jump to: navigation, search
m (1 revision)
Line 12: Line 12:
 
|-
 
|-
 
|{{Event | name=Action | params=ButtonName As String | description= | newinversion=}}
 
|{{Event | name=Action | params=ButtonName As String | description= | newinversion=}}
 +
|-
 +
|{{Event | name=Close | description= | newinversion=}}
 
|-
 
|-
 
|{{Event | name=DisplayChanged | params=minHeight As Integer | description= | newinversion=}}
 
|{{Event | name=DisplayChanged | params=minHeight As Integer | description= | newinversion=}}
Line 20: Line 22:
 
|-
 
|-
 
|{{Event | name=PaintMore | params=buttonIndex As Integer, g As Graphics, x As integer, y As integer, w As integer, h As integer | description= | newinversion=}}
 
|{{Event | name=PaintMore | params=buttonIndex As Integer, g As Graphics, x As integer, y As integer, w As integer, h As integer | description= | newinversion=}}
|-
 
|{{Event | name=Refreshed | description= | newinversion=}}
 
 
|-
 
|-
  
Line 32: Line 32:
 
|class=titleClass colspan=3|Properties
 
|class=titleClass colspan=3|Properties
 
|-
 
|-
|width=33%|{{Property | name=Bold | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=Bold | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=enableScroll | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=enableScroll | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=SelectedColor | type=Color | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=SelectedColor | type=Color | description= | readonly=no | newinversion= | version=1.5.2}}
 
|-
 
|-
|width=33%|{{Property | name=Button | type=TBButton | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=Border | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=ForceVertical | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=ForceVertical | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=TextFont | type=String | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=TextFont | type=String | description= | readonly=no | newinversion= | version=1.5.2}}
 
|-
 
|-
|width=33%|{{Property | name=ButtonType | type=Integer | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=Button | type=TBButton | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=InitialValue | type=Integer | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=InitialValue | type=Integer | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=TextSize | type=Integer | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=TextSize | type=Integer | description= | readonly=no | newinversion= | version=1.5.2}}
 
|-
 
|-
|width=33%|{{Property | name=DisplayType | type=Integer | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=ButtonType | type=Integer | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=Italic | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=Italic | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=Underline | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=Underline | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
 
|-
 
|-
|width=33%|{{Property | name=DrawFrame | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=DisplayType | type=Integer | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=minHeight | type=Integer | description= | readonly=yes | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=minHeight | type=Integer | description= | readonly=yes | newinversion= | version=1.5.2}}
  
 
|-
 
|-
|width=33%|{{Property | name=enableCustomize | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=DrawFrame | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=minWidth | type=Integer | description= | readonly=yes | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=minWidth | type=Integer | description= | readonly=yes | newinversion= | version=1.5.2}}
  
 
|-
 
|-
|width=33%|{{Property | name=enableDrag | type=Boolean | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=enableCustomize | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
|width=33%|{{Property | name=redrawTime | type=Double | description= | readonly=no | newinversion= | version=1.4}}
+
|width=33%|{{Property | name=redrawTime | type=Double | description= | readonly=no | newinversion= | version=1.5.2}}
  
 
|-
 
|-
 +
|width=33%|{{Property | name=enableDrag | type=Boolean | description= | readonly=no | newinversion= | version=1.5.2}}
 +
|width=33%|{{Property | name=RightClickMenu | type=MenuItem | description= | readonly=no | newinversion= | version=1.5.2}}
 
|}
 
|}
 
 
  
  
Line 77: Line 77:
 
|-
 
|-
 
|width=50%|{{Method | name=CountVisible | description= | returntype=Integer | newinversion=}}
 
|width=50%|{{Method | name=CountVisible | description= | returntype=Integer | newinversion=}}
|width=50%|{{Method | name=Redraw | description= | newinversion=}}
+
|width=50%|{{Method | name=Redisplay | description= | newinversion=}}
 
|-
 
|-
 
|width=50%|{{Method | name=CreateButton | params=Caption As String, Name As String = "", HelpTag As String = "", Icon As Picture = Nil, SmallIcon As Picture = Nil, Enabled As Boolean = True, Visible As Boolean = True, Menu As MenuItem = Nil, Align As Integer = 0 | description= | newinversion=}}
 
|width=50%|{{Method | name=CreateButton | params=Caption As String, Name As String = "", HelpTag As String = "", Icon As Picture = Nil, SmallIcon As Picture = Nil, Enabled As Boolean = True, Visible As Boolean = True, Menu As MenuItem = Nil, Align As Integer = 0 | description= | newinversion=}}
Line 91: Line 91:
 
|}
 
|}
  
 
{| class=methodTable
 
|-
 
|class=titleClass colspan=1|Shared Methods
 
|-
 
|{{Method | name=Register | params=Name As String, ProductKey As String, SerialKey As Integer | description= | returntype=Boolean | newinversion=}}
 
|-
 
 
|-
 
|}
 
  
  
Line 128: Line 118:
  
 
==History==
 
==History==
 +
 +
===Version 1.5.2===
 +
Released December 25th, 2013
 +
 +
*New:
 +
**RightClickMenu to have direct access to the Right click menu when user right-clicks the TBCanvas
 +
**Redisplay function to completely refresh the internal buffers
 +
 +
*Fix:
 +
**Fixed a crash when closing the containing Window
 +
**The Toolbar is now correctly refreshed when adding/inserting/deleting a Toolbar button.<br/>
 +
Call the [[TBCanvas.Redisplay|Redisplay]] [[TBCanvas.Button|Button]] if you edit a button directly.
 +
 +
===Version 1.5===
 +
Released December 25th, 2013
 +
 +
*New:
 +
**The CustomToolbar is now Retina Ready
 +
**Better Graphics on Mac OS X.
 +
**Border Property.
 +
 +
*Deprecated:
 +
**DrawFrame (use [[TBCanvas.Border|Border]] instead).
 +
 +
===Version 1.4.1===
 +
 +
 +
*Fix:
 +
**Bug when no icon is set
 +
**Bug with Button width when [[TBCanvas.TextSize|TextSize]] isn't 0
  
 
===Version 1.4===
 
===Version 1.4===
Released 19 March 2012
+
Released March 19th, 2012
  
 
*New:
 
*New:
Line 136: Line 156:
  
 
===Version 1.2===
 
===Version 1.2===
Released 15 December 2009
+
Released December 15th, 2009
  
 
*New:
 
*New:
**Method: GetButton(theName As String) <br/> Lets you get a handle to a [[TBCanvas.Button|Button]] by using its name.
+
**Method: GetButton(theName As String) <br/> Lets you get a handle to a button by using its name.
 
**Method: Redraw() is now a public method. It used to be Protected.
 
**Method: Redraw() is now a public method. It used to be Protected.
 
**Button "Name" property is now ReadOnly
 
**Button "Name" property is now ReadOnly
Line 153: Line 173:
  
 
*New:
 
*New:
**New constructor for Toolbar [[TBCanvas.Button|Button]]
+
**New constructor for Toolbar button
**For [[TBCanvas.Button|Button]] with menus, if the menuitem has a tag, then the tag is passed in the menu event. If not, the caption is passed.
+
**For button with menus, if the menuitem has a tag, then the tag is passed in the menu event. If not, the caption is passed.
  
 
*Fix:
 
*Fix:
**Fixed MenuItem display when a [[TBCanvas.Button|Button]] is hidden because of the width of the toolbar
+
**Fixed MenuItem display when a button is hidden because of the width of the toolbar
  
  
Line 173: Line 193:
 
==See Also==
 
==See Also==
  
[[TBButton]] class; [[TBLanguage]] Module.
+
[[TBButton]] class; TBLanguage Module.

Revision as of 16:14, 9 February 2015

This Custom Control based on a Canvas acts like REALBasic's toolbars.
5 layouts are integrated (Big Icons, Small Icons, with labels or not...).

Buttons can have a ContextualMenu and a HelpTag.
Text Separators can be displayed between buttons.


Events
Action
Close
DisplayChanged
DrawBackground
HelpTagText
PaintMore


Properties
Bold enableScroll SelectedColor
Border ForceVertical TextFont
Button InitialValue TextSize
ButtonType Italic Underline
DisplayType minHeight
DrawFrame minWidth
enableCustomize redrawTime
enableDrag RightClickMenu


Methods
Append Insert
Count Push
CountVisible Redisplay
CreateButton Remove
CreateTextSeparator Remove
GetButton
Insert


Class Constants

DisplayType

The following class constants can be used to specify the value of DisplayType property.

Class Constant Description
TypeBigIcons Big Icons with no caption
TypeBigIconsLabel Big Icons with caption (default)
TypeLabelsOnly Only the caption is displayed
TypeSmallIcons Small Icons with no caption
TypeSmallIconsLabel Small Icons with caption

History

Version 1.5.2

Released December 25th, 2013

  • New:
    • RightClickMenu to have direct access to the Right click menu when user right-clicks the TBCanvas
    • Redisplay function to completely refresh the internal buffers
  • Fix:
    • Fixed a crash when closing the containing Window
    • The Toolbar is now correctly refreshed when adding/inserting/deleting a Toolbar button.

Call the Redisplay Button if you edit a button directly.

Version 1.5

Released December 25th, 2013

  • New:
    • The CustomToolbar is now Retina Ready
    • Better Graphics on Mac OS X.
    • Border Property.
  • Deprecated:
    • DrawFrame (use Border instead).

Version 1.4.1

  • Fix:
    • Bug when no icon is set
    • Bug with Button width when TextSize isn't 0

Version 1.4

Released March 19th, 2012

  • New:
    • Display types: TypeMediumIcon, TypeMediumIconLabel
      When medium icon is selected, it expects to have a 24x24 picture in the Button.Icon property. (Customer request)

Version 1.2

Released December 15th, 2009

  • New:
    • Method: GetButton(theName As String)
      Lets you get a handle to a button by using its name.
    • Method: Redraw() is now a public method. It used to be Protected.
    • Button "Name" property is now ReadOnly
    • Property: ForceVertical As Boolean
  • Fix:
    • Fixed and tested on REALBasic 2008r1 up to 2009r5


Version 1.1

Released 08 November 2009

  • New:
    • New constructor for Toolbar button
    • For button with menus, if the menuitem has a tag, then the tag is passed in the menu event. If not, the caption is passed.
  • Fix:
    • Fixed MenuItem display when a button is hidden because of the width of the toolbar



Version 1.0

Released 01 May 2009


External link

Download page: http://www.jeremieleroy.com/products.php#Toolbar

See Also

TBButton class; TBLanguage Module.