⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u_toolbar.htm

📁 I made a lot of changed on this object,such as * // 1.Encapsulates all code in one userobjet,s
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<HTML>
<TITLE>u_toolbar
</TITLE>


<BODY BGCOLOR="#FFFFFF">
<TABLE><TR><TD>
<H1>
u_toolbar
</TR></TR></TABLE>
<HR SIZE=1>

<TABLE WIDTH=100%>
<TR><TD VALIGN=TOP WIDTH=200><B>Ancestor</B></TD>
<TD WIDTH=100%>
UserObject
<BR><BR>
</TD></TR>

<TABLE WIDTH=100%>
<TR><TD VALIGN=TOP WIDTH=200><B>Hierarchy</B></TD>
<TD WIDTH=100%>
<UL><LI>u_toolbar<UL><LI>UserObject</UL></UL>
</TD></TR>

<TR><TD VALIGN=TOP WIDTH=200><B>Author</B></TD>
<TD WIDTH=100%>
None
<BR><BR>
</TD></TR>

<TR><TD VALIGN=TOP><B>Library</B></TD>
<TD>
toolbar.pbl
<BR><BR>
</TD></TR>

<TR><TD VALIGN=TOP><B>Description</B></TD>
<TD>
The toolbar can build itself from the menu properties of
the window it is placed up or can be programmed to
generate specific toolbar buttons.
<BR><BR>
</TD></TR>

<TR><TD VALIGN=TOP><B>Usage</B></TD>
<TD>

<BR><BR>
</TD></TR>

<TR><TD VALIGN=TOP><B>Model</B></TD>
<TD>
<TABLE BORDER=1>
   <TR><TD BGCOLOR="#DDDDDD"><B>u_toolbar</B></TD>
   <TR><TD BGCOLOR="#EEEEEE">//<BR>
Private:<BR>
window iwindow  // points to the window this is on.<BR>
// A count and an array of toolbuttons<BR>
integer ii_buttonTotal = 0<BR>
u_toolbutton itbn_toolbutton[]<BR>
<BR>
//<BR>
integer ii_pixelBarHeight = 28<BR>
integer ii_pixelButtonHeight = 22<BR>
integer ii_pixelButtonWidth = 23<BR>
<BR>
integer ii_pixelPictureHeight = 16<BR>
integer ii_pixelPictureWidth = 16<BR>
<BR>
string is_prefix<BR>
<BR>
// Everything following here is Rui's tooltip stuff<BR>
<BR>
// Misc Constants<BR>
CONSTANT string TOOLTIPS_CLASS  = 'tooltips_class32'<BR>
CONSTANT ulong CW_USEDEFAULT  = 2147483648<BR>
CONSTANT long WM_USER   = 1024<BR>
CONSTANT long WS_EX_TOPMOST  = 8<BR>
CONSTANT long  WM_SETFONT           = 48<BR>
<BR>
// ToolTip Messages<BR>
CONSTANT long TTM_ADDTOOL   = WM_USER + 4<BR>
CONSTANT long TTM_NEWTOOLRECT = WM_USER + 6<BR>
CONSTANT long TTM_RELAYEVENT   = WM_USER + 7<BR>
CONSTANT long TTM_UPDATETIPTEXT = WM_USER + 12<BR>
CONSTANT long TTM_TRACKACTIVATE = WM_USER + 17<BR>
CONSTANT long TTM_TRACKPOSITION = WM_USER + 18<BR>
<BR>
// Public variables and constants<BR>
Public:<BR>
long hWndTT // Tooltip control window handle<BR>
long ToolID = 1 // Tooltip internal ID<BR>
<BR>
// Tooltip flags<BR>
CONSTANT integer TTF_CENTERTIP   = 2<BR>
CONSTANT integer TTF_RTLREADING = 4<BR>
CONSTANT integer TTF_SUBCLASS  = 16<BR>
CONSTANT integer TTF_TRACK  = 32<BR>
CONSTANT integer TTF_ABSOLUTE  = 128<BR>
CONSTANT integer TTF_TRANSPARENT = 256<BR>
CONSTANT integer TTF_DI_SETITEM  = 32768</TD>
   <TR><TD BGCOLOR="#EEEEEE">
   
      <A HREF="#oftbaddButtonstringasnamestringasbitmapstringastooltipintegeraiposition">
      of_tb_addButton
      (as_name, as_bitmap, as_tooltip, ai_position)
      returns u_toolbutton
      </A><BR>
      <A HREF="#oftbaddButtonstringasnamestringasbitmapstringastooltipintegeraipositionbooleanabenabledbooleanabvisiblebooleanabcheckedintegeraispacebefore">
      of_tb_addButton
      (as_name, as_bitmap, as_tooltip, ai_position, ab_enabled, ab_visible, ab_checked, ai_spacebefore)
      returns u_toolbutton
      </A><BR>
      <A HREF="#oftbdraw">
      of_tb_draw
      ()
      returns (none)
      </A><BR>
      <A HREF="#oftbgetCheckedstringasname">
      of_tb_getChecked
      (as_name)
      returns boolean
      </A><BR>
      <A HREF="#oftbgetEnabledstringasname">
      of_tb_getEnabled
      (as_name)
      returns boolean
      </A><BR>
      <A HREF="#oftbgetFilePrefix">
      of_tb_getFilePrefix
      ()
      returns string
      </A><BR>
      <A HREF="#oftbgetMouseOffExtension">
      of_tb_getMouseOffExtension
      ()
      returns string
      </A><BR>
      <A HREF="#oftbgetSpaceBeforestringasname">
      of_tb_getSpaceBefore
      (as_name)
      returns integer
      </A><BR>
      <A HREF="#oftbgetVisiblestringasname">
      of_tb_getVisible
      (as_name)
      returns boolean
      </A><BR>
      <A HREF="#oftbgetWindow">
      of_tb_getWindow
      ()
      returns window
      </A><BR>
      <A HREF="#oftbreadFromMenu">
      of_tb_readFromMenu
      ()
      returns (none)
      </A><BR>
      <A HREF="#oftbsetBitmapmenuamenustringasfilename">
      of_tb_setBitmap
      (amenu, as_filename)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetButtonStyleintegeraibuttonpixelwidthintegeraibuttonpixelheightintegeraipicturepixelwidthintegeraipicturepixelheightstringasprefix">
      of_tb_setButtonStyle
      (ai_buttonpixelwidth, ai_buttonpixelheight, ai_picturepixelwidth, ai_picturepixelheight, as_prefix)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetCheckedmenuamenubooleanabchecked">
      of_tb_setChecked
      (amenu, ab_checked)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetCheckedstringasnamebooleanabchecked">
      of_tb_setChecked
      (as_name, ab_checked)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetEnabledmenuamenubooleanabenabled">
      of_tb_setEnabled
      (amenu, ab_enabled)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetEnabledstringasnamebooleanabenabled">
      of_tb_setEnabled
      (as_name, ab_enabled)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetmouseoffextensionstringasmouseoffextension">
      of_tb_setmouseoffextension
      (as_mouseoffextension)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetRedrawbooleanabredraw">
      of_tb_setRedraw
      (ab_redraw)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetSpacebeforemenuamenuintegeraispacebefore">
      of_tb_setSpacebefore
      (amenu, ai_spacebefore)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetSpacebeforestringasnameintegeraispacebefore">
      of_tb_setSpacebefore
      (as_name, ai_spacebefore)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetvisiblemenuamenubooleanabvisible">
      of_tb_setvisible
      (amenu, ab_visible)
      returns (none)
      </A><BR>
      <A HREF="#oftbsetVisiblestringasnamebooleanabvisible">
      of_tb_setVisible
      (as_name, ab_visible)
      returns (none)
      </A><BR>
      <A HREF="#pfmenuToToolbarreadonlymenuamenu">
      pf_menuToToolbar
      (menu amenu)
      returns (none)
      </A><BR>
      <A HREF="#pfpositionButtons">
      pf_positionButtons
      ()
      returns (none)
      </A><BR>
      <A HREF="#pfsizebuttons">
      pf_sizebuttons
      ()
      returns (none)
      </A><BR>
   
   </TD>
</TABLE>
<P>
</TD></TR>

<TR><TD VALIGN=TOP><B>Functions</B></TD><TD>
<TABLE VALIGN=TOP ALIGN=TOP BORDER=0 WIDTH=100%>

   <TR><TD VALIGN=TOP COLSPAN=2><HR SIZE=1><B>
   <A NAME="oftbaddButtonstringasnamestringasbitmapstringastooltipintegeraiposition">
   of_tb_addButton
   </A>
   </B><BR><BR>
   </TD>
   </TR>
   <TR>
   <TD VALIGN=TOP WIDTH=100><STRONG>Description</TD>
   <TD>
   Add a toolbar button to the toolbar with enabled and
visible defaulting to true, checked defaulting to false
and spacebefore defaulting to zero.
   </TD>
   
   <TR>
   <TD VALIGN=TOP><STRONG>Return</TD>
   <TD>
   u_toolbutton<BR>
   The toolbutton object created by this function.
   </TD>

   <TR>
   <TD VALIGN=TOP><STRONG>Access</TD>
   <TD>
   public
   </TD>
   <TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Arguments</TD>
   <TD>
      
      <TABLE BORDER=1 WIDTH=100%>
      <TR BGCOLOR="#DDDDDD">
      <TD><STRONG>Argument</STRONG></TD>
      <TD><STRONG>DataType</STRONG></TD>
      <TD><STRONG>Description</STRONG></TD>
      </TR>

         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_name</TD>
         <TD>string</TD>
         <TD> An identifying string for the toolbar button
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_bitmap</TD>
         <TD>string</TD>
         <TD> The full filename for the standard size enabled
				butmap to display on the toolbutton
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_tooltip</TD>
         <TD>string</TD>
         <TD> The popup tooltip to display when the mouse is
				over this button.
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>ai_position</TD>
         <TD>integer</TD>
         <TD> The left to right order in which the button is to
				be placed on the toolbar.</TD>
         </TR>
      
      
      

      </TABLE>
      <BR>
      
   </TD></TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Usage</TD>
   <TD><CODE>None</CODE>
   </TD></TR>

   <TR><TD VALIGN=TOP COLSPAN=2><HR SIZE=1><B>
   <A NAME="oftbaddButtonstringasnamestringasbitmapstringastooltipintegeraipositionbooleanabenabledbooleanabvisiblebooleanabcheckedintegeraispacebefore">
   of_tb_addButton
   </A>
   </B><BR><BR>
   </TD>
   </TR>
   <TR>
   <TD VALIGN=TOP WIDTH=100><STRONG>Description</TD>
   <TD>
   Add a toolbar button to the toolbar with enabled and
visible defaulting to true, checked defaulting to false
and spacebefore defaulting to zero.
   </TD>
   
   <TR>
   <TD VALIGN=TOP><STRONG>Return</TD>
   <TD>
   u_toolbutton<BR>
   The toolbutton object created by this function.
   </TD>

   <TR>
   <TD VALIGN=TOP><STRONG>Access</TD>
   <TD>
   public
   </TD>
   <TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Arguments</TD>
   <TD>
      
      <TABLE BORDER=1 WIDTH=100%>
      <TR BGCOLOR="#DDDDDD">
      <TD><STRONG>Argument</STRONG></TD>
      <TD><STRONG>DataType</STRONG></TD>
      <TD><STRONG>Description</STRONG></TD>
      </TR>

         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_name</TD>
         <TD>string</TD>
         <TD> An identifying string for the toolbar button
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_bitmap</TD>
         <TD>string</TD>
         <TD> The full filename for the standard size enabled
				butmap to display on the toolbutton
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_tooltip</TD>
         <TD>string</TD>
         <TD> The popup tooltip to display when the mouse is
				over this button.
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>ai_position</TD>
         <TD>integer</TD>
         <TD> The left to right order in which the button is to
				be placed on the toolbar.
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>ab_enabled</TD>
         <TD>boolean</TD>
         <TD> Indicates if the button is to available on
				creation.
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>ab_visible</TD>
         <TD>boolean</TD>
         <TD> Indicates if the button is to visible on creation.
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>ab_checked</TD>
         <TD>boolean</TD>
         <TD> Indicates if the button is to checked down on
				creation.
				</TD>
         </TR>
      
         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>ai_spacebefore</TD>
         <TD>integer</TD>
         <TD> Indicates the amount of space to appear
				between the previous button and the new button created.</TD>
         </TR>
      
      
      

      </TABLE>
      <BR>
      
   </TD></TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Usage</TD>
   <TD><CODE>None</CODE>
   </TD></TR>

   <TR><TD VALIGN=TOP COLSPAN=2><HR SIZE=1><B>
   <A NAME="oftbdraw">
   of_tb_draw
   </A>
   </B><BR><BR>
   </TD>
   </TR>
   <TR>
   <TD VALIGN=TOP WIDTH=100><STRONG>Description</TD>
   <TD>
   Draw the toolbar together with all the buttons. Before
this function is called, the buttons must first be
created using of_tb_readFromMenu() or of_tb_addButton()
   </TD>
   
   <TR>
   <TD VALIGN=TOP><STRONG>Return</TD>
   <TD>
   (none)<BR>
   
   </TD>

   <TR>
   <TD VALIGN=TOP><STRONG>Access</TD>
   <TD>
   public
   </TD>
   <TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Arguments</TD>
   <TD>
None
   </TD></TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Usage</TD>
   <TD><CODE>None</CODE>
   </TD></TR>

   <TR><TD VALIGN=TOP COLSPAN=2><HR SIZE=1><B>
   <A NAME="oftbgetCheckedstringasname">
   of_tb_getChecked
   </A>
   </B><BR><BR>
   </TD>
   </TR>
   <TR>
   <TD VALIGN=TOP WIDTH=100><STRONG>Description</TD>
   <TD>
   Determine if a toolbar button is currently checked
   </TD>
   
   <TR>
   <TD VALIGN=TOP><STRONG>Return</TD>
   <TD>
   boolean<BR>
   TRUE if the toolbar button is currently checked
   </TD>

   <TR>
   <TD VALIGN=TOP><STRONG>Access</TD>
   <TD>
   public
   </TD>
   <TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Arguments</TD>
   <TD>
      
      <TABLE BORDER=1 WIDTH=100%>
      <TR BGCOLOR="#DDDDDD">
      <TD><STRONG>Argument</STRONG></TD>
      <TD><STRONG>DataType</STRONG></TD>
      <TD><STRONG>Description</STRONG></TD>
      </TR>

         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_name</TD>
         <TD>string</TD>
         <TD> The identifying string of the toolbar button to
				test</TD>
         </TR>
      
      
      

      </TABLE>
      <BR>
      
   </TD></TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Usage</TD>
   <TD><CODE>None</CODE>
   </TD></TR>

   <TR><TD VALIGN=TOP COLSPAN=2><HR SIZE=1><B>
   <A NAME="oftbgetEnabledstringasname">
   of_tb_getEnabled
   </A>
   </B><BR><BR>
   </TD>
   </TR>
   <TR>
   <TD VALIGN=TOP WIDTH=100><STRONG>Description</TD>
   <TD>
   Determine if a toolbar button is currently enabled
   </TD>
   
   <TR>
   <TD VALIGN=TOP><STRONG>Return</TD>
   <TD>
   boolean<BR>
   TRUE if the toolbar button is currently enabled
   </TD>

   <TR>
   <TD VALIGN=TOP><STRONG>Access</TD>
   <TD>
   public
   </TD>
   <TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Arguments</TD>
   <TD>
      
      <TABLE BORDER=1 WIDTH=100%>
      <TR BGCOLOR="#DDDDDD">
      <TD><STRONG>Argument</STRONG></TD>
      <TD><STRONG>DataType</STRONG></TD>
      <TD><STRONG>Description</STRONG></TD>
      </TR>

         <TR VALIGN=TOP BGCOLOR="EEEEEE">
         <TD>as_name</TD>
         <TD>string</TD>
         <TD> The identifying string of the toolbar button to
				test</TD>
         </TR>
      
      
      

      </TABLE>
      <BR>
      
   </TD></TR>

   <TR>
   <TD VALIGN=TOP><STRONG>Usage</TD>
   <TD><CODE>None</CODE>
   </TD></TR>

   <TR><TD VALIGN=TOP COLSPAN=2><HR SIZE=1><B>
   <A NAME="oftbgetFilePrefix">
   of_tb_getFilePrefix
   </A>
   </B><BR><BR>
   </TD>
   </TR>
   <TR>
   <TD VALIGN=TOP WIDTH=100><STRONG>Description</TD>
   <TD>
   Return the file prefix currently set for the toolbar. The
file prefix is used to differentiate filenames for
bitmaps if different syles of bitmap are available within
the same application. For example if a file prefix of
"large-" is currently set then "c:\mydoc\open.bmp" will
be translated to "c:\mydoc\large-open.bmp" before the
bitmap is loaded.
   </TD>
   
   <TR>
   <TD VALIGN=TOP><STRONG>Return</TD>
   <TD>
   string<BR>
   The current file prefix
   </TD>

   <TR>
   <TD VALIGN=TOP><STRONG>Access</TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -