Initial: flux text FoxBin2Prg (git urmareste .??2 in-arbore, binarele VFP git-ignored)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-16 10:55:38 +03:00
commit 2f59024385
1271 changed files with 820556 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
<title>
A simple guide on how to use ThemedControls
</title>
<body>
<p>Add the following files to your project:</p>
<ul>
<li>Text files from Other tab in Project Manager<br>Ctl32.h (mark it as "Excluded" from your project)<br>ThemedControls.h (mark it as "Excluded" from your project)<br>Themes.xml (mark it as "Excluded" from your project)<br><em>*** Don't forget to distribute these xml file together with your application! ***</em><br><br>
<li>Applications from Code tab in Project Manager<br>System.app (GDIPlusX from VFPX)<br><em>*** Don't forget to distribute these app file together with your application! ***<br><br></em>
<li><em></em>Programs from Code tab in Project Manager<br>Ctl32.prg<br>Ctl32_Api.prg<br>Ctl32_Classes.prg<br>Ctl32_Functions.prg<br>Ctl32_Structures.prg<br>Ctl32_Vfp2c32.prg<br><br>
<li>Classes tab in Project Manager<br>Buttons.vcx<br>Ctl32.vcx<br>ExplorerBar.vcx<br>OutlookNavBar.vcx<br>ThemedControls.vcx<br>ThemedControlsBuilders.vcx (mark it as "Excluded" from your project)<br>ToolBox.vcx<br>VFPX.vcx<br>ZoomNavBar.vcx<br><em>*** Don't use controls from Buttons.vcx, ExplorerBar.vcx, OutlookNavBar.vcx, ToolBox.vcx and ZoomNavBar.vcx directly because they are base classes. Use the subclassed controls in ThemedControls.vcx. ***</em></li></ul>
<p><strong></strong>&nbsp;</p>
<p><strong><font color="#0000ff">Before use any ThemedControl:</font></strong> </p>
<p>ThemesManager and BindWindowsEventsProxy objects used to handle themes are created automatically, but you need to destroy them before finish your application. </p>
<blockquote>
<p><pre>* Destroy ThemesManager object<br>If Vartype(_Screen.ThemesManager)=="O"<br>&nbsp;&nbsp; _Screen.RemoveObject("ThemesManager")<br>Endif</p><p>* Destroy BindWindowsEventsProxy object<br>If Type("_vfp.BindWindowsEventsProxy")<>"U"<br> _vfp.BindWindowsEventsProxy = Null<br>Endif</p></pre></blockquote>
<p>&nbsp;</p>
<p><strong>To use Button:</strong>
<ol>
<li>Add a ThemedButton object from ThemedControls.vcx to your form;
<li>Double click CustomBuilder property in Properties Window to show the Builder;
<li>Fill the properties and click in <em>Save and Exit</em> button;
<li>Use Click method to handle the button click.</li></ol>
<p>&nbsp;</p>
<p><strong></strong>
<p><strong>To use ExplorerBar:</strong>
<ol>
<li>Add a ThemedExplorerGroup object from ThemedControls.vcx to your form;
<li>Double click CustomBuilder property in Properties Window to show the Builder;
<li>Fill the properties and click in <em>Save and Exit</em> button;
<li>Click with right mouse button in ThemedExplorerGroup and choose Edit from shortcut menu to edit the control;
<li>Click with right mouse button in cntUserControls and choose Edit from shortcut menu to edit the control;
<li>Place any control that you want inside cntUserControls;
<li>Repeat steps from 1 to 6 to create how much groups you want;
<li>Add a ThemedExplorerBar object from ThemedControls.vcx to your form;
<li>Select all ThemedExplorerGroups you created and press CTRL + X in your keyboard;
<li>Click with right mouse button in ThemedExplorerBar and choose Edit from shortcut menu to edit the control;
<li>Press CTRL + V in your keyboard to move all ThemedExplorerGroups inside ThemedExplorerBar.</li></ol>
<blockquote>
<p>Or</p></blockquote>
<ol>
<li>Add a ThemedExplorerBar object from ThemedControls.vcx to your form;
<li>Double click CustomBuilder property in Properties Window to show the Builder;
<li>Fill the properties and click in <em>Add this group to the bar</em> button;
<li>Repeat step 3 to create how much groups you want;
<li>Click with right mouse button in ThemedExplorerBar and choose Edit from shortcut menu to edit the control;
<li>Click with right mouse button in ThemedExplorerGroup and choose Edit from shortcut menu to edit the control;
<li>Click with right mouse button in cntUserControls and choose Edit from shortcut menu to edit the control;
<li>Place any control that you want inside cntUserControls;
<li>Repeat steps from 6 to 8 for each group you created.</li></ol>
<p><strong></strong>&nbsp;</p>
<p><strong>To use OutlookNavBar:</strong></p>
<ol>
<li>Add a ThemedOutlookNavBar object from ThemedControls.vcx to your form;
<li>Click with right mouse button in ThemedOutlookNavbar and choose Edit from shortcut menu to edit the control;
<li>Click in the empty control area to select the Panes pagreframe object;
<li>Set the PageCount property to the number of buttons that you want to display;
<li>In the Properties Window, activate each page and set Caption, HotKey, Picture16 and Picture24 properties;
<li>Add the controls you want to display in each page (you can add any control: TreeView, TextBox, CommandButton, ...);
<li>Use ButtonClicked method to handle the correspondent button click. This method receive 3 parameters about the button clicked: lnNumber, lcCaption and lcPicture24.</li></ol>
<p><em>*** Note that at run time, the control will create a button for each page and will use Caption, HotKey, Picture16 and Picture24 page properties as the source of caption and picture button properties. ***</em></p>
<p>&nbsp;</p>
<p><strong>To use ToolBox:</strong>
<ol>
<li>Add a ThemedToolBox object from ThemedControls.vcx to your form;
<li>Click with right mouse button in ThemedToolBox and choose Edit from shortcut menu to edit the control;
<li>Click in the empty control area to select the Panes pagreframe object;
<li>Set the PageCount property to the number of titles that you want to display;
<li>In the Properties Window, activate each page and set Caption property;
<li>Add the controls you want to display in each page (you can add any control: TreeView, TextBox, CommandButton, ...);
<li>Use TitleClicked method to handle the correspondent title click. This method receive a parameter named lcTitle containing the name of title clicked.</li></ol>
<p><em>*** Note that at run time, the control will create a title for each page and will use Caption page property as the source of caption title property. ***</em></p>
<p>&nbsp;</p>
<p><strong>To use ZoomNavBar:</strong>
<ol>
<li>Add a ThemedZoomNavBar object from ThemedControls.vcx to your form;
<li>In the Init method, place the code to add the buttons that you want to display:<br>
<p><pre>DoDefault()<br>With This<br>&nbsp;&nbsp; .AddButton("Printers","Manage your printers.","Printer96.png")<br>&nbsp;&nbsp; .AddButton("Display","Change the display settings.","Monitor96.png")<br>&nbsp;&nbsp; .AddButton("Explorer","Show computer's files and folders.","Folder96.png")<br>&nbsp;&nbsp; *<br>&nbsp;&nbsp; .AddButton("Separator")<br>&nbsp;&nbsp; *<br>&nbsp;&nbsp; .AddButton("ControlPanel","Change your OS settings.","ControlPanel96.png")<br>&nbsp;&nbsp; .AddStackButton("ControlPanel","Button1","Add/Remove programs","Software32.png")<br>&nbsp;&nbsp; .AddStackButton("ControlPanel","Button2","Hardware settings","Hardware32.png")<br>&nbsp;&nbsp; .AddStackButton("ControlPanel","Button3","Network settings","Network32.png")<br>Endwith</pre>
<li>Use AddButton method to add a button and AddStackButton to add an option to a button menu.<br>Sintax:<br><pre>AddButton( cButtonName, cToolTip, cImagePathAndName )<br>AddStackButton( cParentButtonName, cButtonName, cToolTip, cImagePathAndName )</pre>
<li>Use ButtonClicked and StackButtonClicked to handle the correspondent button click:<br><pre>Lparameters lcName<br>Do Case<br>&nbsp;&nbsp; Case lcName=="Printers"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; apiShellExecute(0, "Open", "Control.exe", "Printers", "", 1)<br>&nbsp;&nbsp; Case lcName=="Display"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; apiShellExecute(0, "Open", "Control.exe", "Desk.cpl", "", 1)<br>&nbsp;&nbsp; Case lcName=="Explorer"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; apiShellExecute(0, "Explore", "", "", "", 1)<br>&nbsp;&nbsp; Otherwise<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Messagebox("Button '"+lcName+"' was clicked!")<br>Endcase</pre>
<p></p></li></ol>
<p>
<p>&nbsp; <p>If you have questions, suggestions or want to report bugs, feel free to contact me.</p>
<p>&nbsp;</p>
<p>Emerson Santon Reed<br><a href="mailto:emerson_reed@hotmail.com">emerson_reed@hotmail.com</a></p>
</body>

2484
utile/ctl32/Themes.xml Normal file

File diff suppressed because it is too large Load Diff

295
utile/ctl32/buttons.vc2 Normal file
View File

@@ -0,0 +1,295 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="buttons.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS button AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="imgBackgroundLeft" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="imgBackgroundMiddle" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="imgBackgroundRight" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdFocus" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="shpMouseHandler" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="imgIcon" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblCaption" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: changetheme && Occurs when theme change.
*m: initthemedcontrol
*m: setimages && Internal to the class.
*p: custombuilder
*p: imgleftfocused
*p: imgleftnotfocused
*p: imgmiddlefocused
*p: imgmiddlenotfocused
*p: imgrightfocused
*p: imgrightnotfocused
*p: initialised
*p: lblfocusedcolor
*p: lblnotfocusedcolor
*p: type && Specify the button type: 0 - Normal or 1 - Hot Tracking.
*p: version
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
HIDDEN imgleftfocused,imgleftnotfocused,imgmiddlefocused,imgmiddlenotfocused,imgrightfocused,imgrightnotfocused,initialised,lblfocusedcolor,lblnotfocusedcolor
PROTECTED Init,Resize
*<PropValue>
BackStyle = 0
BorderWidth = 0
custombuilder = Double click here to open Builder
Height = 32
imgleftfocused = ("")
imgleftnotfocused = =""
imgmiddlefocused = =""
imgmiddlenotfocused = ("")
imgrightfocused = =""
imgrightnotfocused = =""
initialised = .F.
lblfocusedcolor = 0
lblnotfocusedcolor = 0
Name = "button"
type = 0
version = 3.5.0
Width = 160
_memberdata = <VFPData>
<memberdata name="buttoncolor" type="property" display="ButtonColor"/>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
<memberdata name="setimages" type="method" display="SetImages"/>
<memberdata name="imgleftfocused" type="property" display="ImgLeftFocused"/>
<memberdata name="imgrightfocused" type="property" display="ImgRightFocused"/>
<memberdata name="imgmiddlefocused" type="property" display="ImgMiddleFocused"/>
<memberdata name="imgleftnotfocused" type="property" display="ImgLeftNotFocused"/>
<memberdata name="imgrightnotfocused" type="property" display="ImgRightNotFocused"/>
<memberdata name="imgmiddlenotfocused" type="property" display="ImgMiddleNotFocused"/>
<memberdata name="version" type="property" display="Version"/>
<memberdata name="initialised" type="property" display="Initialised"/>
<memberdata name="custombuilder" type="property" display="CustomBuilder" script="Local lnControls, laObjects[1]&#xA;m.lnControls = Aselobj(m.laObjects)&#xA;If m.lnControls # 0&#xA; Local loObject, lcClassLib, loBuilder&#xA; m.loObject = m.laObjects[1]&#xA; m.lcClassLib = Addbs(Justpath(m.loObject.ClassLibrary))+&quot;ThemedControlsBuilders.vcx&quot;&#xA; Set Classlib To (m.lcClassLib) Additive&#xA; m.loBuilder = Createobject(&quot;ButtonBuilder&quot;, m.loObject)&#xA; m.loBuilder.Show()&#xA;Endif"/>
<memberdata name="lblfocusedcolor" type="property" display="LblFocusedColor"/>
<memberdata name="lblnotfocusedcolor" type="property" display="LblNotFocusedColor"/>
<memberdata name="type" type="property" display="Type"/>
<memberdata name="initthemedcontrol" type="method" display="InitThemedControl"/>
</VFPData>
*</PropValue>
ADD OBJECT 'cmdFocus' AS commandbutton WITH ;
Caption = "", ;
Left = 0, ;
Name = "cmdFocus", ;
Style = 1, ;
TabIndex = 1, ;
Top = -20
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'imgBackgroundLeft' AS image WITH ;
BackStyle = 0, ;
Left = 0, ;
Name = "imgBackgroundLeft", ;
Top = -20
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'imgBackgroundMiddle' AS image WITH ;
BackStyle = 0, ;
Left = 0, ;
Name = "imgBackgroundMiddle", ;
Top = -20
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'imgBackgroundRight' AS image WITH ;
BackStyle = 0, ;
Left = 0, ;
Name = "imgBackgroundRight", ;
Top = -20
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'imgIcon' AS image WITH ;
BackStyle = 0, ;
Height = 24, ;
Left = 3, ;
Name = "imgIcon", ;
Top = 4, ;
Width = 24
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'lblCaption' AS label WITH ;
BackStyle = 0, ;
Caption = "Caption", ;
FontBold = .T., ;
FontSize = 8, ;
Height = 16, ;
Left = 31, ;
Name = "lblCaption", ;
TabIndex = 2, ;
Top = 8, ;
Width = 132
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'shpMouseHandler' AS shape WITH ;
BackStyle = 0, ;
BorderStyle = 0, ;
Left = 0, ;
Name = "shpMouseHandler", ;
Top = -20
*< END OBJECT: BaseClass="shape" />
PROCEDURE changetheme && Occurs when theme change.
With _Screen.ThemesManager
If This.Type==0
This.ImgLeftFocused = .GetMember("Button.Left.Focused.Picture")
This.ImgMiddleFocused = .GetMember("Button.Middle.Focused.Picture")
This.ImgRightFocused = .GetMember("Button.Right.Focused.Picture")
This.ImgLeftNotFocused = .GetMember("Button.Left.NotFocused.Picture")
This.ImgMiddleNotFocused = .GetMember("Button.Middle.NotFocused.Picture")
This.ImgRightNotFocused = .GetMember("Button.Right.NotFocused.Picture")
Else
This.imgBackgroundLeft.Picture = .GetMember("Button.Left.HotTracking.Picture")
This.imgBackgroundMiddle.Picture = .GetMember("Button.Middle.HotTracking.Picture")
This.imgBackgroundRight.Picture = .GetMember("Button.Right.HotTracking.Picture")
Endif
This.LblFocusedColor = .GetMember("Button.Focused.FontColor")
This.LblNotFocusedColor = .GetMember("Button.NotFocused.FontColor")
This.SetImages(.F.)
Endwith
ENDPROC
PROTECTED PROCEDURE Init
Thisform.ShowTips = .T.
With This
.Initialised = .T.
.Resize()
*
* Reorder objects
.imgBackgroundMiddle.ZOrder(0)
.imgBackgroundLeft.ZOrder(0)
.imgBackgroundRight.ZOrder(0)
.imgIcon.ZOrder(0)
.lblCaption.ZOrder(0)
.cmdFocus.Caption = This.lblCaption.Caption
.cmdFocus.ZOrder(0)
.shpMouseHandler.ZOrder(0)
*
.InitThemedControl()
Endwith
ENDPROC
HIDDEN PROCEDURE initthemedcontrol
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
PROTECTED PROCEDURE Resize
If This.Initialised
With This.imgBackgroundLeft
.Height = This.Height
.Left = 0
.Top = 0
.Width = 2
Endwith
*
With This.imgBackgroundMiddle
.Stretch = 2
.Height = This.Height
.Left = 2
.Top = 0
.Width = This.Width - 4
Endwith
*
With This.imgBackgroundRight
.Height = This.Height
.Left = This.Width - 2
.Top = 0
.Width = 2
Endwith
*
With This.cmdFocus
.Height = This.Height - 6
.Left = 3
.Top = 3
.Width = This.Width - 6
Endwith
*
With This.shpMouseHandler
.Height = This.Height
.Left = 0
.Top = 0
.Width = This.Width
Endwith
*
With This.imgIcon
.Height = 24
.Left = 3
.Top = 4
.Width = 24
Endwith
*
With This.lblCaption
.Height = 16
.Left = 31
.Top = 8
.Width = This.Width - 34
Endwith
Endif
ENDPROC
PROCEDURE setimages && Internal to the class.
Lparameters llFocus
With This
If This.Type==0
If llFocus
.imgBackgroundLeft.Picture = .ImgLeftFocused
.imgBackgroundMiddle.Picture = .ImgMiddleFocused
.imgBackgroundRight.Picture = .ImgRightFocused
Else
.imgBackgroundLeft.Picture = .ImgLeftNotFocused
.imgBackgroundMiddle.Picture = .ImgMiddleNotFocused
.imgBackgroundRight.Picture = .ImgRightNotFocused
Endif
Else
Store llFocus To ;
.imgBackgroundLeft.Visible, ;
.imgBackgroundMiddle.Visible, ;
.imgBackgroundRight.Visible
Endif
If llFocus
.lblCaption.ForeColor = .LblFocusedColor
Else
.lblCaption.ForeColor = .LblNotFocusedColor
Endif
.cmdFocus.Visible = .F.
.cmdFocus.Visible = .T.
Endwith
ENDPROC
PROCEDURE cmdFocus.Click
This.Parent.Click()
ENDPROC
PROCEDURE cmdFocus.KeyPress
Lparameters nKeyCode, nShiftAltCtrl
If nKeyCode==13
Nodefault
This.Parent.Click()
Endif
ENDPROC
PROCEDURE shpMouseHandler.Click
This.Parent.cmdFocus.SetFocus()
This.Parent.Click()
ENDPROC
PROCEDURE shpMouseHandler.MouseEnter
Lparameters nButton, nShift, nXCoord, nYCoord
This.Parent.SetImages(.T.)
ENDPROC
PROCEDURE shpMouseHandler.MouseLeave
Lparameters nButton, nShift, nXCoord, nYCoord
This.Parent.SetImages(.F.)
ENDPROC
ENDDEFINE

4557
utile/ctl32/ctl32.h Normal file

File diff suppressed because it is too large Load Diff

39
utile/ctl32/ctl32.prg Normal file
View File

@@ -0,0 +1,39 @@
********************************************************************************
*!* ctl32.prg
********************************************************************************
*!* This is the main file for the ctl32 classes. This gets called by
*!* each and every class in the Init event.
#Include ctl32.h
*!* Adding this file location to the path list. ADDITIVE is not used, it seems
*!* to have problems with expressions, so to avoid using macro substitution:
If .F.
Local m.lcPath As String
m.lcPath = Addbs(Justpath(Sys(16)))
If Empty(Set("Path")) Then
Set Path To (m.lcPath)
Else
If Not m.lcPath $ Set("Path") Then
Set Path To (Set("Path") + ";" + m.lcPath)
Endif
Endif
*!* Load the main visual classes VCX file:
If Not "CTL32.VCX" $ Upper(Set("Classlib")) Then
Set Classlib To m.lcPath + "ctl32.vcx" Additive
Endif
Endif
*!* Load ctl32 modules:
Do ctl32_api.prg
Do ctl32_classes.prg
Do ctl32_functions.prg
Do ctl32_structures.prg
Do ctl32_vfp2c32.prg
Return

25
utile/ctl32/ctl32.txt Normal file
View File

@@ -0,0 +1,25 @@
ctl32 Classes README FILE - Carlos Alloatti - calloatti@gmail.com
ctl32_scontainer scrollable container by Carlos Alloatti & Malcolm Greene
http://www.ctl32.com.ar/
TESTED ONLY IN VFP9, Windows 2000, XP, Vista
This classes are free to use, please contribute reporting bugs,
proposing changes and updates.
To use these classes you only need the following files added them to your project:
ctl32.h (excluded)
ctl32.prg
ctl32.vct
ctl32.vcx
ctl32_api.prg
ctl32_classes.prg
ctl32_functions.prg
ctl32_structures.prg
ctl32_vfp2c32.prg
vfpx.vct
vfpx.vcx

3282
utile/ctl32/ctl32.vc2 Normal file

File diff suppressed because it is too large Load Diff

1956
utile/ctl32/ctl32_api.prg Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,594 @@
********************************************************************************
*!* ctl32_classes.prg
********************************************************************************
#Include ctl32.h
If Not Sys(16) $ Upper(Set("Procedure")) Then
Set Procedure To Sys(16) Additive
Endif
********************************************************************************
Define Class ctl32_menu As Custom
Height = 0
MenuId = 0
Protected _MemberData
_MemberData = '<VFPData>' + ;
'<memberdata name="" type="property" display=""/>' + ;
'</VFPData>'
Enddefine
********************************************************************************
Define Class ctl32_menuitem As Custom
BarBreak = ""
Break = ""
CanRaiseEvents = ""
Caption = ""
Checked = FALSE
Container = ""
DefaultItem = FALSE
DesignMode = ""
Enabled = FALSE
Events = ""
MenuId = 0
Index = ""
IsParent = ""
MdiList = ""
MdiListItem = ""
MenuId = 0
MenuItems = ""
MergeOrder = ""
MergeType = ""
Mnemonic = ""
Name = "MenuItem"
OwnerDrawn = ""
RadioCheck = FALSE
Shortcut = ""
ShowShortcut = ""
Site = ""
Tag = ""
Visible = ""
ItemID = 0
Picture = ""
PictureObject = FALSE
PictureId = 0
DisabledPicture = ""
DisabledPictureObject = FALSE
DisabledPictureId = 0
DownPicture = ""
DownPictureObject = FALSE
DownPictureId = 0
SubMenuId = 0
Protected _MemberData
_MemberData = '<VFPData>' + ;
'<memberdata name="" type="property" display=""/>' + ;
'</VFPData>'
Procedure SubMenuId_Assign
Lparameters m.vNewVal
*!* Destroy any previous submenu:
If This.SubMenuId > 0 Then
apiDestroyMenu(This.SubMenuId)
Endif
This.SubMenuId = m.vNewVal
If This.ItemID = 0 Then
Return
Endif
*!* update menu item submenu info:
Local ;
m.lcMenuItemInfo As String,;
m.loMenuItemInfo As _MENUITEMINFO
m.loMenuItemInfo = Createobject("_MENUITEMINFO")
m.loMenuItemInfo.fMask = MIIM_SUBMENU
m.loMenuItemInfo.hSubMenu = This.SubMenuId
m.lcMenuItemInfo = m.loMenuItemInfo.Value
apiSetMenuItemInfo(This.MenuId, This.ItemID, MF_BYCOMMAND, @m.lcMenuItemInfo)
m.loMenuItemInfo = .Null.
Release m.loMenuItemInfo
Endproc
Procedure Picture_Assign
Lparameters m.vNewVal
*!* Here we store the value to use, HBMMENU_CALLBACK
*!* If a numeric system bitmap is choosen, we use that
Local m.hbmpItem As Integer
m.hbmpItem = 0
Do Case
Case Vartype(m.vNewVal) = "N"
This.Picture = ""
This.PictureId = m.vNewVal
m.hbmpItem = This.PictureId
Case Vartype(m.vNewVal) = "C"
This.Picture = m.vNewVal
If File(m.vNewVal)
This.PictureObject = LoadPicture(m.vNewVal)
This.PictureId = This.PictureObject.Handle
Else
This.PictureId = 0
Endif
If ctlGetOsVersion() < NTDDI_VISTA
m.hbmpItem = HBMMENU_CALLBACK
Endif
Otherwise
This.Picture = ""
This.PictureId = 0
If ctlGetOsVersion() < NTDDI_VISTA
m.hbmpItem = HBMMENU_CALLBACK
Endif
Endcase
If This.ItemID = 0 Then
Return
Endif
Local m.lcMenuItemInfo As String
Local m.loMenuItemInfo As _MENUITEMINFO
m.loMenuItemInfo = Createobject("_MENUITEMINFO")
m.loMenuItemInfo.fMask = MIIM_BITMAP
m.loMenuItemInfo.hbmpItem = m.hbmpItem
m.lcMenuItemInfo = m.loMenuItemInfo.Value
apiSetMenuItemInfo(This.MenuId, This.ItemID, MF_BYCOMMAND, @m.lcMenuItemInfo)
m.loMenuItemInfo = .Null.
Endproc
Procedure Caption_Assign
Lparameters vNewVal
This.Caption = m.vNewVal
Endproc
Procedure Caption_Access
Return This.Caption
Endproc
Procedure DefaultItem_Assign
Lparameters vNewVal
If Vartype(m.vNewVal) = "N" Then
If m.vNewVal = 0 Then
m.vNewVal = FALSE
Else
m.vNewVal = TRUE
Endif
Endif
This.DefaultItem = m.vNewVal
If This.ItemID = 0 Then
Return
Endif
If This.DefaultItem = TRUE Then
apiSetMenuDefaultItem(This.MenuId, This.ItemID, MF_BYCOMMAND)
Else
apiSetMenuDefaultItem(This.MenuId, -1, MF_BYPOSITION)
Endif
Endproc
Procedure Enabled_Assign
Lparameters vNewVal
If Vartype(m.vNewVal) = "N" Then
If m.vNewVal = 0 Then
m.vNewVal = FALSE
Else
m.vNewVal = TRUE
Endif
Endif
This.Enabled = m.vNewVal
If This.ItemID = 0 Then
Return
Endif
If This.Enabled = TRUE Then
apiEnableMenuItem(This.MenuId, This.ItemID, Bitor(MF_BYCOMMAND, MF_ENABLED))
Else
apiEnableMenuItem(This.MenuId, This.ItemID, Bitor(MF_BYCOMMAND, MF_GRAYED))
Endif
Endproc
Procedure Checked_Assign
Lparameters vNewVal
If Vartype(m.vNewVal) = "N" Then
If m.vNewVal = 0 Then
m.vNewVal = FALSE
Else
m.vNewVal = TRUE
Endif
Endif
This.Checked = m.vNewVal
If This.ItemID = 0 Then
Return
Endif
If This.Checked = TRUE Then
apiCheckMenuItem(This.MenuId, This.ItemID , Bitor(MF_BYCOMMAND, MF_CHECKED))
Else
apiCheckMenuItem(This.MenuId, This.ItemID , Bitor(MF_BYCOMMAND, MF_UNCHECKED))
Endif
Endproc
Procedure RadioCheck_Assign
Lparameters vNewVal
If Vartype(m.vNewVal) = "N" Then
If m.vNewVal = 0 Then
m.vNewVal = FALSE
Else
m.vNewVal = TRUE
Endif
Endif
This.RadioCheck = m.vNewVal
If This.ItemID = 0 Then
Return
Endif
*!* Get current fType, we set fMask to MIIM_FTYPE
Local ;
m.lcMenuItemInfo As String, ;
m.loMenuItemInfo As _MENUITEMINFO, ;
m.lfType As Integer
m.loMenuItemInfo = Createobject("_MENUITEMINFO")
*!* Build MenuItemInfo structure:
m.loMenuItemInfo.fMask = MIIM_FTYPE
m.lcMenuItemInfo = m.loMenuItemInfo.Value
If apiGetMenuItemInfo(This.MenuId, This.ItemID , MF_BYCOMMAND, @m.lcMenuItemInfo) <> 0 Then
m.loMenuItemInfo.Value = m.lcMenuItemInfo
If This.RadioCheck = TRUE Then
m.loMenuItemInfo.fType = Bitor(MFT_RADIOCHECK, m.loMenuItemInfo.fType)
Else
m.loMenuItemInfo.fType = Bitxor(MFT_RADIOCHECK, Bitor(MFT_RADIOCHECK, m.loMenuItemInfo.fType))
Endif
m.lcMenuItemInfo = m.loMenuItemInfo.Value
apiSetMenuItemInfo(This.MenuId, This.ItemID , MF_BYCOMMAND, m.lcMenuItemInfo)
m.loMenuItemInfo = .Null.
Endif
Endproc
Enddefine
********************************************************************************
Define Class ctl32_statusbar_panel As Custom
Height = 16
Width = 120
*-- Specifies the icon displayed for a Form at run time when the Form is minimized.
ctlicon = ""
ctlcaption = ""
ctlformat = 0
*-- Specifies the text that appears as a ToolTip for a control.
ctltooltiptext = ""
ctlindex = 0
*-- Right x value position for Panel
_right = -1
_oicon = ""
*-- Specifies if an object is visible or hidden.
ctlvisible = .T.
*-- Specifies if a control is automatically resized to fit its contents.
ctlautosize = .T.
_width = 0
*-- Specifies the alignment of text associated with a control.
ctlalignment = 0
ctlwidth = ""
ctlname = ""
Name = "ctl32_statusbar_panel"
Procedure ctlIcon_assign
Lparameters vNewVal
Local lnHandle
This.ctlicon = m.vNewVal
This._oicon = .Null.
*!* 2006-07-17 Now takes icon handle too //Anton
Do Case
Case Vartype(This.ctlicon) = T_NUMERIC
m.lnHandle = m.vNewVal
Case Vartype(This.ctlicon) = T_CHARACTER And File(This.ctlicon)
This._oicon = LoadPicture(This.ctlicon)
m.lnHandle = This._oicon.Handle
Otherwise
m.lnHandle = 0
Endcase
apiSendMessageInteger(This.Parent._ControlHWnd, SB_SETICON, This.ctlindex, m.lnHandle)
If This.Parent._ControlHWnd <> 0 And This.ctlindex <> 0 And This.Parent._Creating = FALSE Then
This.Parent.ctlResizePanels()
Endif
Endproc
Procedure ctlcaption_assign
Lparameters vNewVal
*!* 2006-06-27 Added Transform()
This.ctlcaption = Alltrim(Transform(m.vNewVal))
Local lcPadLeft, lcPadRight, lcCaption
m.lcCaption = m.vNewVal
*!* we add spaces so text does not fit and tooltips show
Do Case
Case This.ctlalignment = 1 And This.ctlautosize = FALSE && Right
m.lcPadLeft = TABCHAR + TABCHAR
m.lcPadRight = Space(1)
Case This.ctlalignment = 2 And This.ctlautosize = FALSE && Center
m.lcPadLeft = TABCHAR
m.lcPadRight = Space(0)
Otherwise && Left
m.lcPadLeft = Space(0)
m.lcPadRight = Space(10)
*!* Add one space to left if this is PanelMessage and
*!* ctlAlignment is left, so it separates the text a little from border
If This.ctlindex = 0
m.lcPadLeft = m.lcPadLeft + Space(1)
Endif
Endcase
*!* If changing indicator panels Caption, let tmrUpdater update captions:
If This.Name = "PanelOvr" Then
This.Parent._OldOVR = Not Insmode()
Endif
If This.Name = "PanelNum" Then
This.Parent._OldNUM = Not Numlock()
Endif
If This.Name = "PanelCaps" Then
This.Parent._OldCAPS = Not Capslock()
Endif
*!* If setting Caption for Message Panel
If This.ctlindex = 0
This.Parent._OldMessage = Sys(2015)
Endif
m.lcCaption = m.lcPadLeft + m.lcCaption + m.lcPadRight + NULA
*!* Do not set Panel Caption for ProgressBar:
If This.ctlindex <> 1 Then
apiSendMessageString(This.Parent._ControlHWnd, SB_SETTEXTA, This.ctlindex , m.lcCaption)
Endif
If This.Parent._ControlHWnd <> 0 And This.ctlindex <> 0 And This.Parent._Creating = FALSE Then
This.Parent.ctlResizePanels()
Endif
Endproc
Procedure ctlformat_assign
*!* Property only valid for PanelDate
Lparameters vNewVal
This.ctlformat = m.vNewVal
If This.Name = "PanelDate" Then
If This.ctlformat > 0 Then
This.ctlcaption = ctlGetDateFormat(This.ctlformat)
Else
This.ctlcaption = ""
Endif
Endif
Endproc
Procedure ctltooltiptext_assign
Lparameters vNewVal
This.ctltooltiptext = m.vNewVal
If Len(m.vNewVal) > 0 Then
m.vNewVal = Space(1) + This.ctltooltiptext + Space(1)
Endif
apiSendMessageString(This.Parent._ControlHWnd,SB_SETTIPTEXTA, This.ctlindex, m.vNewVal)
Endproc
Procedure ctlvisible_assign
Lparameters vNewVal
If Vartype(m.vNewVal) = "N" Then
If m.vNewVal = 0 Then
m.vNewVal = FALSE
Else
m.vNewVal = TRUE
Endif
Endif
If Vartype(m.vNewVal) <> "L" Then
Messagebox("Parameter must be Logical: " + Program(), 16)
Return
Endif
This.ctlvisible = m.vNewVal
If This.Parent._ControlHWnd <> 0 And This.Parent._Creating = FALSE Then
This.Parent.ctlResizePanels()
Endif
Endproc
*-- Called when creating the statusbar to update all data of Panels
Procedure _updateall
This.ctlcaption = This.ctlcaption
This.ctlformat = This.ctlformat
This.ctlicon = This.ctlicon
This.ctltooltiptext = This.ctltooltiptext
This.ctlvisible = This.ctlvisible
Endproc
Procedure ctlautosize_assign
Lparameters vNewVal
If Vartype(m.vNewVal) = "N" Then
If m.vNewVal = 0 Then
m.vNewVal = FALSE
Else
m.vNewVal = TRUE
Endif
Endif
*!* Index 0 is first Panel, PanelMessage, that should always have ctlAutosize = FALSE
If This.ctlindex = 0 Then
This.ctlautosize = FALSE
Else
This.ctlautosize = m.vNewVal
*!* Reset caption to get rid of center/right codes if ctlAutosize is TRUE
This.ctlcaption = This.ctlcaption
Endif
Endproc
Procedure ctlalignment_assign
Lparameters vNewVal
This.ctlalignment = m.vNewVal
*!* If message panel, force update
If This.ctlindex = 0
This.Parent._OldMessage = Sys(2015)
Endif
This.ctlcaption = This.ctlcaption
Endproc
Procedure ctlname_access
Return This.Name
Endproc
Procedure ctlname_assign
Lparameters vNewVal
This.Name = m.vNewVal
Endproc
Procedure ctlwidth_access
Return This.Width
Endproc
Procedure ctlwidth_assign
Lparameters vNewVal
This.Width = m.vNewVal
Endproc
Procedure Destroy
This._oicon = .Null.
Endproc
Enddefine
********************************************************************************
Define Class ctl32_statusbar_toolbar As Toolbar
Caption = "ctl32_statusbar_toolbar"
Height = 16
Left = 0
Top = 51
Visible = .F.
Width = 32028
ShowWindow = 1
Name = "ctl32_statusbar_toolbar"
Add Object ctlHeightShape As Shape With ;
Top = 3, ;
Left = 5, ;
Height = 13, ;
Width = 16384, ;
Name = "ctlHeightShape"
Procedure Init
*!* Hide the toolbar thru API so it is still there but invisible
With This
.Dock(TOOL_BOTTOM, 0, 0)
.Visible = TRUE
apiShowWindow(.HWnd, SW_HIDE)
Endwith
Endproc
Procedure ctlHeightShape.Click
This.Parent.Dock(3, 0, 0)
Endproc
Procedure ctlHeightShape.Init
If ctlGetOsVersion() >= NTDDI_VISTA && Vista
This.Height = 13
Else
This.Height = 17
Endif
Endproc
Enddefine
********************************************************************************
Define Class ctl32_statusbar_timer As Timer
Height = 23
Width = 23
Interval = 100
_Interval = 100
_IntervalTrace = 10000
Name = "ctl32_statusbar_timer"
Procedure Timer
*!* 20070701 Added trace aware timer, suggested by ajh
If Wvisible("trace") Or ;
Wvisible("debugger") Or ;
Wvisible("call") Or ;
Wvisible("watch") Or ;
Wvisible("locals")
If This.Interval # This._IntervalTrace
This.Interval = This._IntervalTrace
Endif
Else
If This.Interval # This._Interval
This.Interval = This._Interval
Endif
Endif
This.Parent.ctlUpdatePanels()
Endproc
Enddefine
********************************************************************************
*!* END ctl32_classes
********************************************************************************

View File

@@ -0,0 +1,212 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="ctl32_common.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS _util AS custom
*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />
#INCLUDE "ctl32.h"
*<DefinedPropArrayMethod>
*m: _hinstance
*m: _hosthwnd
*m: _isthemeactive
*m: _objtoclient
*m: _osversion
*m: _strformatbytesize
*m: _themestatus
*m: _vfpwndproc
*p: ctlabout
*p: ctlversion
*</DefinedPropArrayMethod>
*<PropValue>
ctlabout = ctl32_util - Carlos Alloatti
ctlversion = 20061010
Name = "_util"
*</PropValue>
PROCEDURE Init
Local Array laDeclaredDlls(1,3)
Local lnLen
m.lnLen = Adlls(m.laDeclaredDlls)
*!* win32api is used instead of the library name, check these:
*!* blogs.msdn.com/calvin_hsia/archive/2006/04/27/585305.aspx
*!* blogs.msdn.com/calvin_hsia/archive/2006/04/24/582479.aspx
*!* "User32.dll, Gdi32.dll, Kernel32.dll , Advapi32.dll and Mpr.dll are searched (in that order)"
If Ascan(m.laDeclaredDlls, [GetWindowLong], 1, m.lnLen , 2, 15) = 0
Declare Integer GetWindowLong In win32api As GetWindowLong;
Integer HWnd, ;
Integer nIndex
Endif
If This._OSVersion() >= CON_OS_WINXP Then
If Ascan(m.laDeclaredDlls, [IsThemeActive], 1, m.lnLen , 2, 15) = 0
Declare Integer IsThemeActive In uxtheme.Dll As IsThemeActive
Endif
Endif
If Ascan(m.laDeclaredDlls, [StrFormatByteSize], 1, m.lnLen , 2, 15) = 0
Declare Integer StrFormatByteSize In shlwapi;
integer dw,;
string szBuf,;
integer uiBufSize
Endif
ENDPROC
PROCEDURE _hinstance
*!* The GetWindowLong function retrieves information about the specified window.
*!* GWL_HINSTANCE retrieves a handle to the application instance.
Return GetWindowLong(_vfp.HWnd, GWL_HINSTANCE)
ENDPROC
PROCEDURE _hosthwnd
*!* the control must have a parent window. In the case of a standard form, its the
*!* hWnd of the form. If we have a Top Level Form, we have
*!* to find the hWnd of the "inner" window of the Form
Local m.nhwnd
If ThisForm.ShowWindow = CON_SHOWWIN_ASTOPLEVELFORM Or ThisForm.ScrollBars > 0 Then
*!* Get hWnd of client window of Top Level Form //Craig Boyd//
#If Version(CON_VER_NUM) >= 900
m.nhwnd = Sys(2327, Sys(2325, Sys(2326, ThisForm.HWnd)))
#Else
m.nhwnd = GetWindow(ThisForm.HWnd, GW_CHILD)
#Endif
Else
m.nhwnd = ThisForm.HWnd
Endif
Return m.nhwnd
ENDPROC
PROCEDURE _isthemeactive
*!* Tests if a visual style for the current application is active.
Return (This._OSVersion() >= CON_OS_WINXP) And (IsThemeActive() = 1)
ENDPROC
PROCEDURE _objtoclient
*!* This replaces OBJTOCLIENT that has bugs with pageframes
Parameters toControl, tcPosition
Local lnPosition As Integer
m.tcPosition = Upper(m.tcPosition)
m.lnPosition = 0
Do Case
Case m.tcPosition $ [TB]
Do While Not Upper(m.toControl.BaseClass) == [FORM]
If Pemstatus(m.toControl, [Top], CON_PEMSTAT_DEFINED) Then
m.lnPosition = m.lnPosition + m.toControl.Top
Endif
If Upper(m.toControl.BaseClass) == [PAGE] Then
If m.toControl.Parent.TabOrientation = CON_TABOR_TOP Then && Top
m.lnPosition = m.lnPosition + ;
m.toControl.Parent.Height - ;
m.toControl.Parent.PageHeight - ;
m.toControl.Parent.BorderWidth * 2
Else
m.lnPosition = m.lnPosition + 1
Endif
Endif
m.toControl = m.toControl.Parent
Enddo
If m.tcPosition == [B] Then
m.lnPosition = m.lnPosition + This.Height
Endif
Case m.tcPosition $ [LR]
Do While Not Upper(m.toControl.BaseClass) == [FORM]
If Pemstatus(m.toControl, [Left], CON_PEMSTAT_DEFINED) Then
m.lnPosition = m.lnPosition + m.toControl.Left
Endif
If Upper(m.toControl.BaseClass) == [PAGE]
If m.toControl.Parent.TabOrientation = CON_TABOR_LEFT Then && Left
m.lnPosition = m.lnPosition + ;
m.toControl.Parent.Width - ;
m.toControl.Parent.PageWidth - ;
m.toControl.Parent.BorderWidth * 2
Else
m.lnPosition = m.lnPosition + 1
Endif
Endif
m.toControl = m.toControl.Parent
Enddo
If m.tcPosition == [R] Then
m.lnPosition = m.lnPosition + This.Width
Endif
Endcase
Return m.lnPosition
ENDPROC
PROCEDURE _osversion
*!* Returns a numeric value representing the operating system version
*!* Check ctl32.h for possible values
*!* ie CON_OS_WINXPSP2 = 5010200
Return Val(Os(3)) * 1000000 + Val(Os(4)) * 10000 + Val(Os(8)) * 100 + Val(Os(9))
ENDPROC
PROCEDURE _strformatbytesize
*!* Converts a numeric value into a string that represents the number expressed
*!* as a size value in bytes, kilobytes, megabytes, or gigabytes, depending on the size.
Lparameters tnSize
Local lcBuffer
m.lcBuffer = Space(254)
StrFormatByteSize(m.tnSize, @m.lcBuffer, Len(m.lcBuffer))
m.lcBuffer = Alltrim(m.lcBuffer)
* Remove chr(0)
m.lcBuffer = Left(m.lcBuffer, Len(m.lcBuffer)-1)
Return m.lcBuffer
ENDPROC
PROCEDURE _themestatus
*!* Returns the global status of Themes for a VFP Form
Return ;
This._OSVersion() >= CON_OS_WINXP ;
And IsThemeActive() = 1 ;
And _Screen.Themes ;
And Thisform.Themes
ENDPROC
PROCEDURE _vfpwndproc
*!* The GetWindowLong function retrieves information about the specified window.
*!* GWL_WNDPROC retrieves the address of the window procedure,
*!* or a handle representing the address of the window procedure.
*!* You must use the CallWindowProc function to call the window procedure.
Return GetWindowLong(_vfp.HWnd, GWL_WNDPROC)
ENDPROC
ENDDEFINE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="ctl32_statusbar_fals.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS ctl32_statusbar AS custom
*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*m: ctlclick
*m: newtooltip
*p: ctlicon
*p: ctlmessage
*a: ctlpanels[10,0]
*</DefinedPropArrayMethod>
*<PropValue>
ctlicon =
ctlmessage =
Name = "ctl32_statusbar"
*</PropValue>
PROCEDURE ctlclick
ENDPROC
PROCEDURE Init
Lparameters tnPanelCount
For I = 1 To tnPanelCount
This.ctlpanels(I) = Newobject("ctl32_statusbar_panel","ctl32_statusbar_fals")
Endfor
ENDPROC
PROCEDURE newtooltip
ENDPROC
ENDDEFINE
DEFINE CLASS ctl32_statusbar_panel AS custom
*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*p: ctlcaption
*</DefinedPropArrayMethod>
*<PropValue>
ctlcaption =
Name = "ctl32_statusbar_panel"
*</PropValue>
ENDDEFINE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

505
utile/ctl32/explorerbar.vc2 Normal file
View File

@@ -0,0 +1,505 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="explorerbar.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS explorerbar AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="imgBackground" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Ctl32_Scrollbar" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: changetheme && Occurs when theme change.
*m: initthemedcontrol
*m: reposition && Reposition groups after collapse/expand a group.
*m: scroll && Move the ScrollBar to show the current group.
*p: custombuilder
*p: version && ExplorerBar version.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
PROTECTED Init,Resize
*<PropValue>
Anchor = 7
BorderWidth = 0
custombuilder = Double click here to open Builder
Height = 208
Name = "explorerbar"
version = 3.5.0
Width = 267
_memberdata = <VFPData>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
<memberdata name="version" type="property" display="Version"/>
<memberdata name="reposition" type="method" display="Reposition"/>
<memberdata name="scroll" type="method" display="Scroll"/>
<memberdata name="custombuilder" type="property" display="CustomBuilder" script="Local lnControls, laObjects[1]&#xA;m.lnControls = Aselobj(m.laObjects)&#xA;If m.lnControls # 0&#xA; Local loObject, lcClassLib, loBuilder&#xA; m.loObject = m.laObjects[1]&#xA; m.lcClassLib = Addbs(Justpath(m.loObject.ClassLibrary))+&quot;ThemedControlsBuilders.vcx&quot;&#xA; Set Classlib To (m.lcClassLib) Additive&#xA; m.loBuilder = Createobject(&quot;ExplorerBarBuilder&quot;, m.loObject)&#xA; m.loBuilder.Show()&#xA;Endif"/>
<memberdata name="initthemedcontrol" type="method" display="InitThemedControl"/>
</VFPData>
*</PropValue>
ADD OBJECT 'Ctl32_Scrollbar' AS ctl32_scrollbar WITH ;
ctlorientation = 1, ;
Height = 0, ;
Left = 249, ;
Name = "Ctl32_Scrollbar", ;
Top = -1, ;
Width = 18, ;
lblname.Name = "lblname", ;
ctlTextBox.Name = "ctlTextBox"
*< END OBJECT: ClassLib="ctl32.vcx" BaseClass="container" />
ADD OBJECT 'imgBackground' AS image WITH ;
Height = 0, ;
Name = "imgBackground", ;
Stretch = 2, ;
Top = -1, ;
Width = 249
*< END OBJECT: BaseClass="image" />
PROCEDURE changetheme && Occurs when theme change.
This.imgBackground.Picture = _Screen.ThemesManager.GetMember("ExplorerBar.Background.Picture")
ENDPROC
PROTECTED PROCEDURE Init
This.InitThemedControl()
This.Reposition(.T.)
ENDPROC
HIDDEN PROCEDURE initthemedcontrol
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
PROCEDURE reposition && Reposition groups after collapse/expand a group.
Lparameters llMove
Local lnTop, lnHeight, loGroup
With This.Ctl32_Scrollbar
m.lnTop = .ctlMinimum - .ctlValue
Endwith
m.lnHeight = 0
For Each loGroup In This.Controls
With m.loGroup
If Not Inlist(Upper(.Name),;
"IMGBACKGROUND","CTL32_SCROLLBAR")
If m.llMove
.Top = m.lnTop
.Left = 4
Endif
m.lnTop = .Top + .Height
m.lnHeight = m.lnHeight + .Height
Endif
Endwith
Endfor
m.loGroup = Null
*
With This
Local llScrollBar
llScrollBar = (m.lnHeight > .Height)
With .Ctl32_Scrollbar
If llScrollBar
.ctlMaximum = m.lnHeight
.ctlLargeChange = .Height
Else
If Not .ctlValue==.ctlMinimum
.ctlValue = .ctlMinimum
Endif
Endif
.ctlVisible = llScrollBar
Endwith
Endwith
ENDPROC
PROTECTED PROCEDURE Resize
With This
Store 0 To ;
.imgBackground.Top, ;
.Ctl32_Scrollbar.Top
Store .Height To ;
.imgBackground.Height, ;
.Ctl32_Scrollbar.Height
.imgBackground.Width = .Width
.Reposition(.F.)
Endwith
* The following code ensures that focus rectangle is visible
Try
Local loObject
m.loObject = This.ActiveControl
With m.loObject
If Upper(.Name)=="CMDFOCUS"
This.Scroll(.Parent.Top,.Parent.Height)
.Visible = .F.
.Visible = .T.
Endif
Endwith
m.loObject = Null
Catch
Endtry
ENDPROC
PROCEDURE scroll && Move the ScrollBar to show the current group.
Lparameters lnTop, lnHeight
With This.Ctl32_ScrollBar
If .ctlVisible
.ctlValue = (m.lnTop + m.lnHeight + 1 + .ctlValue) - This.Height
Endif
Endwith
ENDPROC
PROCEDURE Ctl32_Scrollbar.ctlvaluechanged
This.Parent.Reposition(.T.)
ENDPROC
ENDDEFINE
DEFINE CLASS explorergroup AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="imgBackground" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="linBottomBorder" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="linLeftBorder" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="linRightBorder" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cntUserControls" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="imgTitle" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdFocus" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblTitle" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="imgPicture" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="shpMouseHandler" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: activate && Occurs when group receive the focus.
*m: changetheme && Occurs when theme change.
*m: clicked && Occurs when shpMouseHandler or cmdFocus are clicked.
*m: collapse && Occurs when group is collapsed.
*m: expand && Occurs when group is expanded.
*m: highlightheader && Occurs when header receive focus.
*m: initthemedcontrol
*p: custombuilder
*p: imgcollapsehighlighted && Path and name of the button's image displayed when group is collapsed and highlighted.
*p: imgcollapsenothighlighted && Path and name of the button's image displayed when group is collapsed and not highlighted.
*p: imgexpandhighlighted && Path and name of the button's image displayed when group is expanded and highlighted.
*p: imgexpandnothighlighted && Path and name of the button's image displayed when group is expanded and highlighted.
*p: initialheight && Initial group height.
*p: lblhighlight && Highlighted group font color.
*p: lblnothighlight && Not highlighted group font color.
*p: state && Specify if the group is expanded (0) or collapsed (1).
*p: type && Specify if group type is normal (0) or special (1).
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
HIDDEN initialheight
PROTECTED GotFocus,Init,Resize
*<PropValue>
BackStyle = 0
BorderWidth = 0
custombuilder = Double click here to open Builder
Height = 200
imgcollapsehighlighted = ("")
imgcollapsenothighlighted = ("")
imgexpandhighlighted = ("")
imgexpandnothighlighted = ("")
initialheight = 0
lblhighlight = 0
lblnothighlight = 0
Name = "explorergroup"
state = 0
type = 0
Width = 241
_memberdata = <VFPData>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
<memberdata name="collapse" type="method" display="Collapse"/>
<memberdata name="expand" type="method" display="Expand"/>
<memberdata name="highlightheader" type="method" display="HighlightHeader"/>
<memberdata name="state" type="property" display="State"/>
<memberdata name="type" type="property" display="Type"/>
<memberdata name="initialheight" type="method" display="InitialHeight"/>
<memberdata name="clicked" type="method" display="Clicked"/>
<memberdata name="imgcollapsehighlighted" type="property" display="ImgCollapseHighlighted"/>
<memberdata name="imgcollapsenothighlighted" type="property" display="ImgCollapseNotHighlighted"/>
<memberdata name="imgexpandhighlighted" type="property" display="ImgExpandHighlighted"/>
<memberdata name="imgexpandnothighlighted" type="property" display="ImgExpandNotHighlighted"/>
<memberdata name="lblhighlight" type="property" display="LblHighlight"/>
<memberdata name="lblnothighlight" type="property" display="LblNotHighlight"/>
<memberdata name="custombuilder" type="property" display="CustomBuilder" script="Local lnControls, laObjects[1]&#xA;m.lnControls = Aselobj(m.laObjects)&#xA;If m.lnControls # 0&#xA; Local loObject, lcClassLib, loBuilder&#xA; m.loObject = m.laObjects[1]&#xA; m.lcClassLib = Addbs(Justpath(m.loObject.ClassLibrary))+&quot;ThemedControlsBuilders.vcx&quot;&#xA; Set Classlib To (m.lcClassLib) Additive&#xA; m.loBuilder = Createobject(&quot;ExplorerGroupBuilder&quot;, m.loObject)&#xA; m.loBuilder.Show()&#xA;ENDIF"/>
<memberdata name="initthemedcontrol" type="method" display="InitThemedControl"/>
<memberdata name="activate" type="method" display="Activate"/>
</VFPData>
*</PropValue>
ADD OBJECT 'cmdFocus' AS commandbutton WITH ;
Caption = "Command1", ;
Height = 21, ;
Left = 3, ;
Name = "cmdFocus", ;
Style = 1, ;
TabIndex = 2, ;
Top = 14, ;
Width = 235
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cntUserControls' AS container WITH ;
Height = 159, ;
Left = 0, ;
Name = "cntUserControls", ;
TabIndex = 3, ;
Top = 37, ;
Width = 241
*< END OBJECT: BaseClass="container" />
ADD OBJECT 'imgBackground' AS image WITH ;
BackStyle = 0, ;
Height = 159, ;
Left = 0, ;
Name = "imgBackground", ;
Stretch = 2, ;
Themes = .F., ;
Top = 37, ;
Width = 241
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'imgPicture' AS image WITH ;
BackStyle = 0, ;
Height = 32, ;
Left = 0, ;
Name = "imgPicture", ;
Stretch = 2, ;
Top = 4, ;
Width = 32
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'imgTitle' AS image WITH ;
BackStyle = 0, ;
Height = 25, ;
Left = 0, ;
Name = "imgTitle", ;
Stretch = 2, ;
Top = 12, ;
Width = 241
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'lblTitle' AS label WITH ;
Caption = "Label1", ;
FontBold = .T., ;
FontSize = 8, ;
Height = 17, ;
Left = 37, ;
Name = "lblTitle", ;
TabIndex = 1, ;
Top = 16, ;
Width = 176
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'linBottomBorder' AS line WITH ;
Height = 0, ;
Left = 0, ;
Name = "linBottomBorder", ;
Top = 196, ;
Width = 241
*< END OBJECT: BaseClass="line" />
ADD OBJECT 'linLeftBorder' AS line WITH ;
Height = 160, ;
Left = 0, ;
Name = "linLeftBorder", ;
Top = 37, ;
Width = 0
*< END OBJECT: BaseClass="line" />
ADD OBJECT 'linRightBorder' AS line WITH ;
Height = 160, ;
Left = 240, ;
Name = "linRightBorder", ;
Top = 37, ;
Width = 0
*< END OBJECT: BaseClass="line" />
ADD OBJECT 'shpMouseHandler' AS shape WITH ;
BackStyle = 0, ;
BorderStyle = 0, ;
Height = 33, ;
Left = 0, ;
MousePointer = 15, ;
Name = "shpMouseHandler", ;
Top = 4, ;
Width = 241
*< END OBJECT: BaseClass="shape" />
PROCEDURE activate && Occurs when group receive the focus.
ENDPROC
PROCEDURE changetheme && Occurs when theme change.
With _Screen.ThemesManager
Store .GetMember("ExplorerBar.Bordercolor") To ;
This.linLeftBorder.BorderColor, ;
This.linRightBorder.BorderColor, ;
This.linBottomBorder.BorderColor
If This.Type==0
This.ImgCollapseHighlighted = .GetMember("ExplorerBar.NormalGroupCollapseHighlight.Picture")
This.ImgCollapseNotHighlighted = .GetMember("ExplorerBar.NormalGroupCollapseNotHighlight.Picture")
This.ImgExpandHighlighted = .GetMember("ExplorerBar.NormalGroupExpandHighlight.Picture")
This.ImgExpandNotHighlighted = .GetMember("ExplorerBar.NormalGroupExpandNotHighlight.Picture")
This.lblHighlight = .GetMember("ExplorerBar.NormalGroupHighlight.Forecolor")
This.lblNotHighlight = .GetMember("ExplorerBar.NormalGroupNotHighlight.Forecolor")
This.imgBackground.Picture = .GetMember("ExplorerBar.NormalGroupBackground.Picture")
Else
This.ImgCollapseHighlighted = .GetMember("ExplorerBar.SpecialGroupCollapseHighlight.Picture")
This.ImgCollapseNotHighlighted = .GetMember("ExplorerBar.SpecialGroupCollapseNotHighlight.Picture")
This.ImgExpandHighlighted = .GetMember("ExplorerBar.SpecialGroupExpandHighlight.Picture")
This.ImgExpandNotHighlighted = .GetMember("ExplorerBar.SpecialGroupExpandNotHighlight.Picture")
This.lblHighlight = .GetMember("ExplorerBar.SpecialGroupHighlight.Forecolor")
This.lblNotHighlight = .GetMember("ExplorerBar.SpecialGroupNotHighlight.Forecolor")
This.imgBackground.Picture = .GetMember("ExplorerBar.SpecialGroupBackground.Picture")
Endif
This.HighlightHeader(.F.)
Endwith
ENDPROC
PROCEDURE clicked && Occurs when shpMouseHandler or cmdFocus are clicked.
With This
If .State==0
.Collapse()
Else
.Expand()
Endif
.cmdFocus.SetFocus()
.Parent.Scroll(.Top,.Height)
* The following code must not be placed in Collapse
* and Expand methods because I must call Collapse
* in the Init when group must be start collapsed.
Local loObject
loObject = Sys(1270)
If Vartype(loObject)=="O"
If Upper(loObject.Name)==Upper(This.Name)
.HighlightHeader(.T.)
Else
.HighlightHeader(.F.)
Endif
Endif
Endwith
ENDPROC
PROCEDURE collapse && Occurs when group is collapsed.
Local lnHeight
With This
.State = 1
*For m.lnHeight=.Height-1 To 37 Step -1
* .Height = m.lnHeight
* .Parent.Reposition(.T.)
*Endfor
.Height = 37
.Parent.Reposition(.T.)
.cntUserControls.Visible = .F.
Endwith
ENDPROC
PROCEDURE expand && Occurs when group is expanded.
Local lnHeight
With This
.State = 0
*For m.lnHeight=.Height+1 To .InitialHeight
* .Height = m.lnHeight
* .Parent.Reposition(.T.)
*Endfor
.Height = .InitialHeight
.Parent.Reposition(.T.)
.cntUserControls.Visible = .T.
Endwith
ENDPROC
PROTECTED PROCEDURE GotFocus
With This
.Parent.Scroll(.Top,.Height)
.Activate()
Endwith
ENDPROC
PROCEDURE highlightheader && Occurs when header receive focus.
Lparameters llHighlight
With This
If m.llHighlight
.lblTitle.ForeColor = .lblHighlight
.imgTitle.Picture = Iif(.State==0,.ImgCollapseHighlighted,.ImgExpandHighlighted)
Else
.lblTitle.ForeColor = .lblNotHighlight
.imgTitle.Picture = Iif(.State==0,.ImgCollapseNotHighlighted,.ImgExpandNotHighlighted)
Endif
* The following code ensures that focus rectangle is visible.
With .cmdFocus
.Visible = .F.
.Visible = .T.
Endwith
Endwith
ENDPROC
PROTECTED PROCEDURE Init
With This
.InitialHeight = .Height
If Empty(.imgPicture.Picture)
Local lnWidth
With .imgPicture
m.lnWidth = .Width
.Visible = .F.
Endwith
With .lblTitle
.Left = .Left - m.lnWidth
.Width = .Width + m.lnWidth
Endwith
Endif
.lblTitle.BackStyle = 0
.cntUserControls.BorderWidth = 0
.cntUserControls.BackStyle = 0
If .State==1
.Collapse()
Endif
*
.InitThemedControl()
Endwith
ENDPROC
HIDDEN PROCEDURE initthemedcontrol
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
PROTECTED PROCEDURE Resize
With This
Store Max(0,.Height - .shpMouseHandler.Height - 8) To ;
.linLeftBorder.Height, ;
.linRightBorder.Height, ;
.imgBackground.Height, ;
.cntUserControls.Height
.linBottomBorder.Top = (.imgBackground.Top + .imgBackground.Height)
.linBottomBorder.Visible = (.State==0)
Endwith
ENDPROC
PROCEDURE cmdFocus.KeyPress
Lparameters nKeyCode, nShiftAltCtrl
If nKeyCode==13
Nodefault
This.Parent.Clicked()
Endif
ENDPROC
PROCEDURE shpMouseHandler.Click
This.Parent.Clicked()
ENDPROC
PROCEDURE shpMouseHandler.MouseEnter
Lparameters nButton, nShift, nXCoord, nYCoord
This.Parent.HighlightHeader(.T.)
ENDPROC
PROCEDURE shpMouseHandler.MouseLeave
Lparameters nButton, nShift, nXCoord, nYCoord
This.Parent.HighlightHeader(.F.)
ENDPROC
ENDDEFINE

File diff suppressed because it is too large Load Diff

BIN
utile/ctl32/system.app Normal file

Binary file not shown.

View File

@@ -0,0 +1,2 @@
#Define WM_THEMECHANGED 0x031A
#Define GWL_WNDPROC (-4)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

373
utile/ctl32/toolbox.vc2 Normal file
View File

@@ -0,0 +1,373 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="toolbox.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS pane AS page
*< CLASSDATA: Baseclass="page" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*m: caption_assign
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
PROTECTED Destroy,Init
*<PropValue>
BackColor = 255,255,255
Caption = "Page1"
Height = 156
Name = "pane"
Width = 156
_memberdata = <VFPData>
<memberdata name="caption_assign" type="method" display="Caption_Assign"/>
</VFPData>
*</PropValue>
PROCEDURE Activate
With This.Parent.Parent
.TitleClicked(.Controls(This.PageOrder+1).Name)
Endwith
ENDPROC
HIDDEN PROCEDURE caption_assign
Lparameters vNewVal
Store m.vNewVal To This.Caption, ;
This.Parent.Parent.Controls(This.PageOrder+1).lblCaption.Caption
ENDPROC
PROTECTED PROCEDURE Destroy
Try
With This.Parent.Parent
* Remove all titles
Local lnTitle
m.lnTitle = "TITLE"+Transform(This.PageOrder)
.RemoveObject(m.lnTitle)
Endwith
Catch
Endtry
ENDPROC
PROTECTED PROCEDURE Init
With This
.Parent.Parent.Newobject("Title"+Alltrim(Transform(.PageOrder)),;
"Title","ToolBox",,.PageOrder,.Caption)
Endwith
ENDPROC
ENDDEFINE
DEFINE CLASS panes AS pageframe
*< CLASSDATA: Baseclass="pageframe" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*m: pagecount_assign
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
ActivePage = 0
BorderWidth = 0
ErasePage = .T.
Height = 398
MemberClass = "pane"
MemberClassLibrary = toolbox.vcx
Name = "panes"
PageCount = 0
SpecialEffect = 2
Tabs = .F.
Themes = .F.
Width = 198
_memberdata = <VFPData>
<memberdata name="pagecount_assign" type="method" display="PageCount_Assign"/>
</VFPData>
*</PropValue>
HIDDEN PROCEDURE pagecount_assign
Lparameters vNewVal
With This
Local lnActivePage
lnActivePage = .ActivePage
.PageCount = m.vNewVal
*
Do Case
Case .PageCount==0
.ActivePage = 0
Case lnActivePage > .PageCount
.ActivePage = 1
Otherwise
.ActivePage = .ActivePage
Endcase
.Parent.ReArrangeTitles()
Endwith
ENDPROC
ENDDEFINE
DEFINE CLASS title AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="imgBackground" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="imgPicture" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblCaption" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdFocus" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="shpClickHandler" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: changetheme
*m: initthemedcontrol
*p: titleid && Title ID.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
BackStyle = 0
Height = 19
Name = "title"
titleid = 0
Width = 200
_memberdata = <VFPData>
<memberdata name="titleid" type="property" display="TitleID"/>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
</VFPData>
*</PropValue>
ADD OBJECT 'cmdFocus' AS commandbutton WITH ;
Anchor = 10, ;
Caption = "", ;
Height = 15, ;
Left = 2, ;
Name = "cmdFocus", ;
Style = 1, ;
TabIndex = 1, ;
Themes = .F., ;
Top = 2, ;
Width = 196
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'imgBackground' AS image WITH ;
Anchor = 15, ;
Height = 17, ;
Left = 1, ;
Name = "imgBackground", ;
Stretch = 2, ;
Top = 1, ;
Width = 198
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'imgPicture' AS image WITH ;
Anchor = 2, ;
Height = 9, ;
Left = 6, ;
Name = "imgPicture", ;
Top = 5, ;
Width = 9
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'lblCaption' AS label WITH ;
Anchor = 10, ;
BackStyle = 0, ;
Caption = "", ;
FontSize = 8, ;
Height = 17, ;
Left = 26, ;
Name = "lblCaption", ;
TabIndex = 2, ;
Top = 2, ;
Width = 168
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'shpClickHandler' AS shape WITH ;
BackStyle = 0, ;
BorderStyle = 0, ;
Height = 19, ;
Name = "shpClickHandler", ;
Width = 200
*< END OBJECT: BaseClass="shape" />
PROCEDURE changetheme
With _Screen.ThemesManager
This.BorderColor = .GetMember("Title.BorderColor")
This.imgBackground.Left = .GetMember("Title.Background.Left")
This.imgBackground.Width = This.Width - This.imgBackground.Left - 1
This.imgBackground.Picture = .GetMember("ToolTitle.Background.Picture")
This.imgBackground.Anchor = 0
This.imgBackground.Anchor = 15
This.lblCaption.ForeColor = .GetMember("ToolTitle.FontColor")
Endwith
ENDPROC
PROCEDURE Init
Lparameters liID, lcCaption
With This
.TitleID = liID
.lblCaption.Caption = lcCaption
.InitThemedControl()
.Visible = .T.
Endwith
ENDPROC
HIDDEN PROCEDURE initthemedcontrol
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
PROCEDURE cmdFocus.KeyPress
Lparameters nKeyCode, nShiftAltCtrl
Do Case
Case nKeyCode==13
Nodefault
Case Inlist(nKeyCode,43,45)
With This.Parent
Local lnActivePage
lnActivePage = .Parent.Panes.ActivePage
If (nKeyCode==43 And Not .TitleID==lnActivePage) Or ;
(nKeyCode==45 And .TitleID==lnActivePage)
.shpClickHandler.Click()
Endif
Endwith
Endcase
ENDPROC
PROCEDURE shpClickHandler.Click
With This.Parent
If .Parent.Panes.ActivePage==.TitleID
If .Parent.Wrap
.Parent.Panes.ActivePage = Iif(.Parent.Panes.PageCount==.TitleID,1,.TitleID+1)
Else
.Parent.Panes.ActivePage = .TitleID + Iif(.Parent.Panes.PageCount==.TitleID,-1,1)
Endif
Else
.Parent.Panes.ActivePage = .TitleID
Endif
.Parent.ReArrangeTitles()
* Needed to show focus rectangle
Local loTitle
If Upper(Thisform.BaseClass)=="TOOLBAR"
loTitle = This.Parent
Else
loTitle = .Parent.Controls(.Parent.Panes.ActivePage+1)
Endif
With loTitle
.cmdFocus.Visible = .F.
.cmdFocus.Visible = .T.
.SetFocus()
Endwith
loTitle = Null
Endwith
ENDPROC
ENDDEFINE
DEFINE CLASS toolbox AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="Panes" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: changetheme && Occurs when theme change.
*m: initthemedcontrol
*m: rearrangetitles && Internal to the class. Rearrange title to show in correctly and position.
*m: titleclicked && Occurs when a title is clicked.
*p: version && ToolBox version.
*p: wrap && Specify if the focus goes to the first Title (.T.) or to the previous Title (.F.) when the last Title is collapsed.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
PROTECTED Init,Resize,version
*<PropValue>
Anchor = 15
BackColor = 255,255,255
Height = 400
Name = "toolbox"
version = 3.5.0
Width = 200
wrap = .T.
_memberdata = <VFPData>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
<memberdata name="rearrangetitles" type="method" display="ReArrangeTitles"/>
<memberdata name="titleclicked" type="method" display="TitleClicked"/>
<memberdata name="version" type="property" display="Version"/>
<memberdata name="wrap" type="property" display="Wrap"/>
<memberdata name="initthemedcontrol" type="method" display="InitThemedControl"/>
</VFPData>
*</PropValue>
ADD OBJECT 'Panes' AS panes WITH ;
ErasePage = .T., ;
Height = 398, ;
Left = 1, ;
Name = "Panes", ;
Top = 1
*< END OBJECT: ClassLib="toolbox.vcx" BaseClass="pageframe" />
PROCEDURE changetheme && Occurs when theme change.
This.BorderColor = _Screen.ThemesManager.GetMember("Container.BorderColor")
ENDPROC
PROTECTED PROCEDURE Init
This.Panes.ActivePage = 1
This.InitThemedControl()
This.ReArrangeTitles()
ENDPROC
HIDDEN PROCEDURE initthemedcontrol
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
PROCEDURE rearrangetitles && Internal to the class. Rearrange title to show in correctly and position.
Local lnTop, lnTitles, lnHeight, lnTabIndex, loControl, llBottom
lnTop = 0
lnTitles = (This.ControlCount-1)
lnHeight = This.Height
lnTabIndex = 1
For Each loControl In This.Controls
loControl.TabIndex = lnTabIndex
lnTabIndex = lnTabIndex + 1
If Upper(loControl.Class)==Upper("Title")
loControl.Width = This.Width
loControl.Top = lnTop
If (loControl.TitleID)==This.Panes.ActivePage
loControl.imgPicture.Picture = _Screen.ThemesManager.GetMember("Signs.Minus.Picture")
llBottom = .T.
With This.Panes
.Top = loControl.Top + loControl.Height
.TabIndex = lnTabIndex
Endwith
lnTabIndex = lnTabIndex + 1
Else
loControl.imgPicture.Picture = _Screen.ThemesManager.GetMember("Signs.Plus.Picture")
Endif
lnTitles = lnTitles - 1
If Not llBottom
lnTop = lnTop + (loControl.Height-1)
Else
lnTop = This.Height - (lnTitles*(loControl.Height-1)) - 1
lnHeight = Min(lnHeight,lnTop - This.Panes.Top)
Endif
Else
loControl.Width = This.Width - 2
Endif
Endfor
loControl = Null
This.Panes.Height = lnHeight
ENDPROC
PROTECTED PROCEDURE Resize
If This.ControlCount>1 && Execute only after all titles was added
This.ReArrangeTitles()
Endif
ENDPROC
PROCEDURE titleclicked && Occurs when a title is clicked.
Lparameters lcTitle
ENDPROC
ENDDEFINE

103
utile/ctl32/vfpx.vc2 Normal file
View File

@@ -0,0 +1,103 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="vfpx.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS bindwindowseventsproxy AS custom
*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*m: _msghandler
*p: _hwnd
*p: _lparam
*p: _msg
*p: _result
*p: _windowproc
*p: _wparam
*</DefinedPropArrayMethod>
*<PropValue>
Name = "bindwindowseventsproxy"
_hwnd = 0
_lparam = 0
_msg = 0
_result = .NULL.
_windowproc = 0
_wparam = 0
*</PropValue>
PROCEDURE Destroy
#Define WM_THEMECHANGED 0x031A
If Type("This.Parent") # "O" Then
Unbindevents(_vfp.HWnd, WM_THEMECHANGED)
Endif
ENDPROC
PROCEDURE Init
*!* *!* Add BindWindowsEventsProxy property to _VFP :
*!* If Not Pemstatus(_vfp,"BindWindowsEventsProxy", 5)
*!* AddProperty(_vfp,"BindWindowsEventsProxy", .Null.)
*!* Endif
*!* *!* Create BindWindowsEventsProxy object:
*!* If Not Vartype(_vfp.BindWindowsEventsProxy) = "O"
*!* _vfp.BindWindowsEventsProxy = Newobject("BindWindowsEventsProxy", Addbs(Justpath(This.ClassLibrary))+"vfpx.vcx")
*!* Endif
*!* *!* Bind to BindWindowsEventsProxy _Msg property changes:
*!* Bindevent(_vfp.BindWindowsEventsProxy,"_Msg", This,"_VFPMessageHandler")
*!* *!* _VFPMessageHandler procedure
*!* Do Case
*!* Case _vfp.BindWindowsEventsProxy._Msg = WM_THEMECHANGED
*!* *!* Do your theme changing stuff here
*!* Endcase
*!* Never destroy the BindWindowsEventsProxy object, some other object might be using it
#Define WM_THEMECHANGED 0x031A
#Define GWL_WNDPROC (-4)
Declare Integer GetWindowLong In win32api As apiGetWindowLong ;
Integer HWnd, ;
Integer nIndex
Declare Integer CallWindowProc In win32api As apiCallWindowProc ;
Integer lpPrevWndFunc, ;
Integer HWnd, ;
Integer Msg,;
Integer wParam,;
Integer Lparam
This._WindowProc = apiGetWindowLong(_vfp.HWnd, GWL_WNDPROC)
If Type("This.Parent") # "O" Then
Bindevent(_vfp.HWnd, WM_THEMECHANGED, This, "_MsgHandler", 4)
Endif
ENDPROC
PROCEDURE _msghandler
Lparameters HWnd As Integer, Msg As Integer, wParam As Integer, Lparam As Integer
Local lnResult
This._hwnd = m.HWnd
This._wParam = m.wParam
This._lParam = m.lParam
This._Msg = m.Msg
If Isnull(This._Result) Then
m.lnResult = apiCallWindowProc(This._WindowProc, m.HWnd, m.Msg, m.wParam, m.lParam)
Else
m.lnResult = This._Result
This._Result = .Null.
Endif
Return m.lnResult
ENDPROC
ENDDEFINE

882
utile/ctl32/zoomnavbar.vc2 Normal file
View File

@@ -0,0 +1,882 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="zoomnavbar.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS reflectedimage AS image
*< CLASSDATA: Baseclass="image" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*m: enabled_assign
*p: deletedisabledpicture && Internal to the class. Specify if disabled picture must be deleted when control is destroyed.
*p: deletepicture && Internal to the class. Specify if picture must be deleted when control is destroyed.
*p: disabledpicture && Internal to the class. Specifies the graphic to display when the control is disabled.
*p: enabledpicture && Internal to the class. Specifies the graphic to display when the control is enabled.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
BackStyle = 0
deletedisabledpicture = .F.
deletepicture = .F.
disabledpicture = ("")
enabledpicture = ("")
Height = 48
Name = "reflectedimage"
Stretch = 2
Themes = .F.
Width = 48
_memberdata = <VFPData>
<memberdata name="enabled_assign" type="method" display="Enabled_Assign"/>
<memberdata name="disabledpicture" type="property" display="DisabledPicture"/>
<memberdata name="enabledpicture" type="property" display="EnabledPicture"/>
<memberdata name="deletedisabledpicture" type="property" display="DeleteDisabledPicture"/>
<memberdata name="deletepicture" type="property" display="DeletePicture"/>
</VFPData>
*</PropValue>
PROCEDURE Destroy
* Change this method for builder version
* Set picture property to a non existant image to avoid
* errors while deleting temporary reflected image.
This.Picture = "ZoomNavBarFake.bmp"
*
If This.DeleteDisabledPicture
If File(This.DisabledPicture)
Clear Resources (This.DisabledPicture)
Delete File (This.DisabledPicture)
Endif
Endif
If This.DeletePicture
If File(This.EnabledPicture)
Clear Resources (This.EnabledPicture)
Delete File (This.EnabledPicture)
Endif
Endif
DoDefault()
ENDPROC
HIDDEN PROCEDURE enabled_assign
Lparameters vNewVal
With This
If m.vNewVal
.Picture = .EnabledPicture
Else
.Picture = .DisabledPicture
Endif
.Enabled = m.vNewVal
Endwith
ENDPROC
ENDDEFINE
DEFINE CLASS separatorimage AS image
*< CLASSDATA: Baseclass="image" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*m: changetheme
*m: initthemedcontrol
*p: imageid && Internal to the class. Unique identifier.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
BackStyle = 0
Height = 48
imageid = 0
Name = "separatorimage"
Stretch = 2
Themes = .F.
Width = 48
_memberdata = <VFPData>
<memberdata name="imageid" type="property" display="ImageID"/>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
<memberdata name="initthemedcontrol" type="method" display="InitThemedControl"/>
</VFPData>
*</PropValue>
PROCEDURE changetheme
With This
Local lcMemberName
lcMemberName = ""
If Upper(.Parent.Name)=="CNTREFLECTED"
lcMemberName = "Reflected"
Endif
.Picture = _Screen.ThemesManager.GetMember("ZoomNavBar."+lcMemberName+"Separator.Picture")
Endwith
ENDPROC
PROCEDURE Init
* Change this method for builder version
With This
.Top = 0
.InitThemedControl()
.Visible = .T.
Endwith
ENDPROC
HIDDEN PROCEDURE initthemedcontrol
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
ENDDEFINE
DEFINE CLASS stackbutton AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="imgBackground" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblCaption" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="imgPicture" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: changetheme && Internal to the class. Occurs when theme change.
*m: enabled_assign
*m: initthemedcontrol && Internal to the class.
*p: deletedisabledpicture && Internal to the class. Specify if disabled picture must be deleted when control is destroyed.
*p: disabledpicture && Internal to the class. Specifies the graphic to display when the control is disabled.
*p: enabledpicture && Internal to the class. Specifies the graphic to display when the control is enabled.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
BackStyle = 0
BorderWidth = 0
deletedisabledpicture = .F.
disabledpicture = ("")
enabledpicture = ("")
Height = 36
Name = "stackbutton"
Width = 192
_memberdata = <VFPData>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
<memberdata name="initthemedcontrol" type="method" display="InitThemedControl"/>
<memberdata name="enabled_assign" type="method" display="Enabled_Assign"/>
<memberdata name="deletedisabledpicture" type="property" display="DeleteDisabledPicture"/>
<memberdata name="disabledpicture" type="property" display="DisabledPicture"/>
<memberdata name="enabledpicture" type="property" display="EnabledPicture"/>
</VFPData>
*</PropValue>
ADD OBJECT 'imgBackground' AS image WITH ;
BackStyle = 0, ;
Height = 24, ;
Name = "imgBackground", ;
Stretch = 2, ;
Top = 6, ;
Width = 155
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'imgPicture' AS image WITH ;
BackStyle = 0, ;
Height = 32, ;
Left = 157, ;
Name = "imgPicture", ;
Stretch = 2, ;
Top = 2, ;
Width = 32
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'lblCaption' AS label WITH ;
Alignment = 1, ;
BackStyle = 0, ;
Caption = "Label1", ;
FontBold = .T., ;
FontSize = 8, ;
ForeColor = 255,255,255, ;
Height = 16, ;
Left = 5, ;
Name = "lblCaption", ;
Top = 10, ;
Width = 145
*< END OBJECT: BaseClass="label" />
PROCEDURE changetheme && Internal to the class. Occurs when theme change.
This.imgBackground.Picture = _Screen.ThemesManager.GetMember("ZoomNavBar.StackButton.Picture")
ENDPROC
PROCEDURE Destroy
* Change this method for builder version
* Set picture property to a non existant image to avoid
* errors while deleting temporary reflected image.
This.imgPicture.Picture = "ZoomNavBarFake.bmp"
*
If This.DeleteDisabledPicture
If File(This.DisabledPicture)
Clear Resources (This.DisabledPicture)
Delete File (This.DisabledPicture)
Endif
Endif
DoDefault()
ENDPROC
HIDDEN PROCEDURE enabled_assign
Lparameters vNewVal
With This
If m.vNewVal
.imgPicture.Picture = .EnabledPicture
Else
.imgPicture.Picture = .DisabledPicture
Endif
.Enabled = m.vNewVal
Endwith
ENDPROC
PROCEDURE Init
Lparameters lcCaption, lcPicture, lcDisabledPicture, ;
llDeleteDisabledPicture, llEnabled, lnTop
With This
With .lblCaption
.Caption = lcCaption
.Width = Txtwidth(lcCaption,.FontName,.FontSize,"B")*;
Fontmetric(6,.FontName,.FontSize,"B")
Endwith
.DeleteDisabledPicture = llDeleteDisabledPicture
.DisabledPicture = lcDisabledPicture
.EnabledPicture = lcPicture
.Enabled = llEnabled
.imgBackground.Width = .lblCaption.Width + 10
.Top = lnTop
.Width = .imgBackground.Width + ;
5 + .imgPicture.Width
.imgPicture.Left = .Width - 2 - .imgPicture.Width
If .Width > .Parent.Width
.Parent.Width = .Width
Endif
.InitThemedControl()
.Visible = .T.
Endwith
ENDPROC
HIDDEN PROCEDURE initthemedcontrol && Internal to the class.
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
ENDDEFINE
DEFINE CLASS stackcontainer AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="shpMouseHandler" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: buttonclicked && Occurs when a button is clicked.
*m: reposition && Move the stack to the current parent button coordinates.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
BackStyle = 0
BorderWidth = 0
Name = "stackcontainer"
Visible = .F.
_memberdata = <VFPData>
<memberdata name="reposition" type="method" display="Reposition"/>
<memberdata name="buttonclicked" type="method" display="ButtonClicked"/>
</VFPData>
*</PropValue>
ADD OBJECT 'shpMouseHandler' AS shape WITH ;
Anchor = 15, ;
BackStyle = 0, ;
BorderStyle = 0, ;
Height = 75, ;
Name = "shpMouseHandler", ;
Width = 75
*< END OBJECT: BaseClass="shape" />
PROCEDURE buttonclicked && Occurs when a button is clicked.
ENDPROC
PROCEDURE reposition && Move the stack to the current parent button coordinates.
Lparameters lnRight, lnTop
With This
.Left = lnRight - .Width
.Top = lnTop - .Height
.shpMouseHandler.ZOrder(0)
.Visible = .T.
Endwith
ENDPROC
PROCEDURE shpMouseHandler.Click
This.Visible = .F.
Local loObject, lcButton, llEnabled
loObject = Sys(1270)
llEnabled = .T.
Do Case
Case Upper(loObject.Class)=="STACKBUTTON"
lcButton = loObject.Name
llEnabled = loObject.Enabled
Case Upper(loObject.Parent.Class)=="STACKBUTTON"
lcButton = loObject.Parent.Name
llEnabled = loObject.Parent.Enabled
Endcase
loObject = Null
This.Visible = .T.
If llEnabled
This.Parent.Visible = .F.
If Not Empty(lcButton)
This.Parent.ButtonClicked(lcButton)
Endif
Endif
ENDPROC
PROCEDURE shpMouseHandler.MouseLeave
Lparameters nButton, nShift, nXCoord, nYCoord
This.Parent.Visible = .F.
ENDPROC
ENDDEFINE
DEFINE CLASS zoomimage AS image
*< CLASSDATA: Baseclass="image" Timestamp="" Scale="Pixels" Uniqueid="" />
*<DefinedPropArrayMethod>
*m: enabled_assign
*p: deletedisabledpicture && Internal to the class. Specify if disabled picture must be deleted when control is destroyed.
*p: description && Button's function description.
*p: disabledpicture && Internal to the class. Specifies the graphic to display when the control is disabled.
*p: enabledpicture && Internal to the class. Specifies the graphic to display when the control is enabled.
*p: imageid && Internal to the class. Unique identifier.
*p: stack && Internal to the class. A pointer to an StackContainer object.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
BackStyle = 0
deletedisabledpicture = .F.
disabledpicture = ("")
enabledpicture = ("")
Height = 48
imageid = 0
Name = "zoomimage"
stack = .F.
Stretch = 2
Themes = .F.
Width = 48
_memberdata = <VFPData>
<memberdata name="description" type="property" display="Description"/>
<memberdata name="imageid" type="property" display="ImageID"/>
<memberdata name="stack" type="property" display="Stack"/>
<memberdata name="enabled_assign" type="method" display="Enabled_Assign"/>
<memberdata name="deletedisabledpicture" type="property" display="DeleteDisabledPicture"/>
<memberdata name="disabledpicture" type="property" display="DisabledPicture"/>
<memberdata name="enabledpicture" type="property" display="EnabledPicture"/>
</VFPData>
*</PropValue>
PROCEDURE Click
With This.Parent.Parent
If Vartype(This.Stack)=="O"
Bindevent(This.Stack,"ButtonClicked",This.Parent.Parent,"StackButtonClicked",1)
Bindevent(This.Stack.shpMouseHandler,"MouseLeave",This,"MouseLeave",1)
This.Stack.RePosition(.Left+This.Left+This.Width,.Top+3)
Else
.ButtonClicked(.ActiveButtonName)
Endif
Endwith
ENDPROC
PROCEDURE Destroy
This.Stack = Null
* Change this method for builder version
* Set picture property to a non existant image to avoid
* errors while deleting temporary reflected image.
This.Picture = "ZoomNavBarFake.bmp"
*
If This.DeleteDisabledPicture
If File(This.DisabledPicture)
Clear Resources (This.DisabledPicture)
Delete File (This.DisabledPicture)
Endif
Endif
DoDefault()
ENDPROC
HIDDEN PROCEDURE enabled_assign
Lparameters vNewVal
With This
If m.vNewVal
.Picture = .EnabledPicture
Else
.Picture = .DisabledPicture
Endif
.Enabled = m.vNewVal
Endwith
ENDPROC
PROCEDURE MouseEnter
Lparameters nButton, nShift, nXCoord, nYCoord
This.Parent.Parent.ActiveButtonName = This.Name
This.Parent.Parent.ActiveButtonNumber = This.ImageID
This.Parent.Parent.RearrangeButtons()
*
With This.Parent.Parent
With .Ctl32_BalloonTip
.ctlVisible = .F.
.ctlFadeIn = .T.
.ctlFadeOut = .T.
.ctlOffsetY = 1
.ctlAlignment = 6
.ctlPosition = 6
.ctlPositionStyle = 4
.ctlHideDelay = 10000
.ctlCapsLockStyle = 0
.ctlText = This.Description
.ctlVisible = .T.
Endwith
Endwith
ENDPROC
PROCEDURE MouseLeave
Lparameters nButton, nShift, nXCoord, nYCoord
*
With This.Parent.Parent
With .Ctl32_BalloonTip
If .ctlVisible
.ctlVisible = .F.
Endif
Endwith
Endwith
*
Local llStack
llStack = (Vartype(This.Stack)=="O")
If Not (llStack And This.Stack.Visible)
If llStack
Unbindevents(This.Stack,"ButtonClicked",This.Parent.Parent,"StackButtonClicked")
Unbindevents(This.Stack.shpMouseHandler,"MouseLeave",This,"MouseLeave")
Endif
This.Parent.Parent.Parent.Refresh()
This.Parent.Parent.ActiveButtonName = "None"
This.Parent.Parent.ActiveButtonNumber = 0
This.Parent.Parent.RearrangeButtons()
Endif
ENDPROC
ENDDEFINE
DEFINE CLASS zoomnavbar AS container
*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="imgBackground" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="shpMouseHandler" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Ctl32_BalloonTip" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cntZoom" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cntReflected" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: addbutton && Add a new button.
*m: addstackbutton && Add a new stack button.
*m: buttonclicked && Occurs when a button is clicked.
*m: changetheme && Internal to the class. Occurs when theme change.
*m: createadditionalimages && Internal to the class. Create necessary images to achieve the effects.
*m: initthemedcontrol && Internal to the class.
*m: rearrangebuttons && Internal to the class. Rearrange buttons to show in correctly position.
*m: setbuttonstate && Set the button state: enabled or disabled.
*m: setstackbuttonstate && Set the stack button state: enabled or disabled.
*m: stackbuttonclicked && Occurs when a stack button is clicked.
*p: activebuttonname && Internal to the class. Contain the name of the active (zoomed) button.
*p: activebuttonnumber && Internal to the class. Contain the number of the active (zoomed) button.
*p: custombuilder
*p: stretch && Specify if the bar is stretched or not.
*p: version && ZoomNavBar version.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
PROTECTED version
*<PropValue>
activebuttonname = ("None")
activebuttonnumber = 0
Anchor = 14
BackStyle = 0
BorderWidth = 0
custombuilder = Double click here to open Builder
Height = 125
Name = "zoomnavbar"
version = 3.5.0
Width = 200
_memberdata = <VFPData>
<memberdata name="addbutton" type="method" display="AddButton"/>
<memberdata name="buttonclicked" type="method" display="ButtonClicked"/>
<memberdata name="rearrange" type="method" display="ReArrange"/>
<memberdata name="rearrangebuttons" type="method" display="ReArrangeButtons"/>
<memberdata name="version" type="property" display="Version"/>
<memberdata name="transparentimage" type="property" display="TransparentImage"/>
<memberdata name="activebuttonname" type="property" display="ActiveButtonName"/>
<memberdata name="activebuttonnumber" type="property" display="ActiveButtonNumber"/>
<memberdata name="tempfolder" type="property" display="TempFolder"/>
<memberdata name="stretch" type="property" display="Stretch"/>
<memberdata name="addstackbutton" type="method" display="AddStackButton"/>
<memberdata name="stackbuttonclicked" type="method" display="StackButtonClicked"/>
<memberdata name="changetheme" type="method" display="ChangeTheme"/>
<memberdata name="custombuilder" type="property" display="CustomBuilder" script="Local lnControls, laObjects[1]&#xA;m.lnControls = Aselobj(m.laObjects)&#xA;If m.lnControls # 0&#xA; Local loObject, lcClassLib, loBuilder&#xA; m.loObject = m.laObjects[1]&#xA; m.lcClassLib = Addbs(Justpath(m.loObject.ClassLibrary))+&quot;ThemedControlsBuilders.vcx&quot;&#xA; Set Classlib To (m.lcClassLib) Additive&#xA; m.loBuilder = Createobject(&quot;ZoomNavBarBuilder&quot;, m.loObject)&#xA; m.loBuilder.Show()&#xA;Endif"/>
<memberdata name="initthemedcontrol" type="method" display="InitThemedControl"/>
<memberdata name="createadditionalimages" type="method" display="CreateAdditionalImages"/>
<memberdata name="setbuttonstate" type="method" display="SetButtonState"/>
<memberdata name="setstackbuttonstate" type="method" display="SetStackButtonState"/>
</VFPData>
*</PropValue>
ADD OBJECT 'cntReflected' AS container WITH ;
BackStyle = 0, ;
BorderWidth = 0, ;
Height = 24, ;
Left = 0, ;
Name = "cntReflected", ;
Top = 99, ;
Width = 200
*< END OBJECT: BaseClass="container" />
ADD OBJECT 'cntZoom' AS container WITH ;
BackStyle = 0, ;
BorderWidth = 0, ;
Height = 96, ;
Left = 0, ;
Name = "cntZoom", ;
Top = 3, ;
Width = 200
*< END OBJECT: BaseClass="container" />
ADD OBJECT 'Ctl32_BalloonTip' AS ctl32_balloontip WITH ;
Height = 0, ;
Name = "Ctl32_BalloonTip", ;
Width = 0, ;
tmrHide.Name = "tmrHide", ;
lblname.Name = "lblname", ;
tmrShow.Name = "tmrShow"
*< END OBJECT: ClassLib="ctl32.vcx" BaseClass="container" />
ADD OBJECT 'imgBackground' AS image WITH ;
BackStyle = 0, ;
BorderStyle = 1, ;
Height = 0, ;
Left = 0, ;
Name = "imgBackground", ;
Stretch = 2, ;
Themes = .F., ;
Top = 75, ;
Width = 0
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'shpMouseHandler' AS shape WITH ;
BackStyle = 0, ;
BorderStyle = 0, ;
Height = 3, ;
Name = "shpMouseHandler", ;
Width = 200
*< END OBJECT: BaseClass="shape" />
PROCEDURE addbutton && Add a new button.
Lparameters lcName, lcDescription, ;
lcPicture, lcReflectedPicture, ;
lcDisabledPicture, lcDisabledReflectedPicture, ;
llEnabled
If Pcount()<7
* To avoid changes to this method call when upgrading from previous versions
llEnabled = .T.
Endif
With This
Local lcClassLibrary, lnControlCount
lcClassLibrary = "ZoomNavBar.vcx"
lnControlCount = .cntZoom.ControlCount+1
If Upper(lcName)=="SEPARATOR"
lcName = lcName + Alltrim(Transform(lnControlCount))
.cntZoom.Newobject( lcName,"SeparatorImage",lcClassLibrary )
.cntReflected.Newobject( lcName,"SeparatorImage",lcClassLibrary )
Else
Local llCreateReflectedPicture, llCreateDisabledPicture, llCreateDisabledReflectedPicture
lcPicture = Fullpath(lcPicture)
*
If Empty(lcReflectedPicture)
lcReflectedPicture = Addbs(_Screen.ThemesManager.TempFolder) + ;
Juststem(lcPicture) + "_Reflected." + Justext(lcPicture)
Endif
llCreateReflectedPicture = Not File(lcReflectedPicture)
If Empty(lcDisabledPicture)
lcDisabledPicture = Addbs(_Screen.ThemesManager.TempFolder) + ;
Juststem(lcPicture) + "_Disabled." + Justext(lcPicture)
Endif
llCreateDisabledPicture = Not File(lcDisabledPicture)
If Empty(lcDisabledReflectedPicture)
lcDisabledReflectedPicture = Addbs(_Screen.ThemesManager.TempFolder) + ;
Juststem(lcPicture) + "_DisabledReflected." + Justext(lcPicture)
Endif
llCreateDisabledReflectedPicture = Not File(lcDisabledReflectedPicture)
*
If llCreateReflectedPicture Or llCreateDisabledPicture Or llCreateDisabledReflectedPicture
.CreateAdditionalImages(lcPicture,;
Iif(llCreateReflectedPicture,lcReflectedPicture,""),;
Iif(llCreateDisabledPicture,lcDisabledPicture,""),;
Iif(llCreateDisabledReflectedPicture,lcDisabledReflectedPicture,""))
Endif
*
.cntZoom.Newobject( lcName,"ZoomImage",lcClassLibrary )
With .cntZoom.Controls(lnControlCount)
.DeleteDisabledPicture = llCreateDisabledPicture
.Description = lcDescription
.DisabledPicture = lcDisabledPicture
.EnabledPicture = lcPicture
.ImageID = lnControlCount
.Top = 48
.Visible = .T.
Endwith
*
.cntReflected.Newobject( lcName,"ReflectedImage",lcClassLibrary )
With .cntReflected.Controls(lnControlCount)
.DeleteDisabledPicture = llCreateDisabledReflectedPicture
.DeletePicture = llCreateReflectedPicture
.DisabledPicture = lcDisabledReflectedPicture
.EnabledPicture = lcReflectedPicture
.Top = 0
.Visible = .T.
Endwith
*
.SetButtonState(lcName,llEnabled)
Endif
If Upper(Thisform.BaseClass)=="TOOLBAR"
This.Width = (lnControlCount*48)+48+24+24+12
Endif
.ReArrangeButtons()
Endwith
ENDPROC
PROCEDURE addstackbutton && Add a new stack button.
Lparameters lcParent, lcName, lcCaption, ;
lcPicture, lcDisabledPicture, llEnabled
If Pcount()<6
* To avoid changes to this method call when upgrading from previous versions
llEnabled = .T.
Endif
If Not Upper(Thisform.BaseClass)=="TOOLBAR"
If Pemstatus(This.cntZoom,lcParent,5)
*
Local llCreateDisabledPicture
lcPicture = Fullpath(lcPicture)
If Empty(lcDisabledPicture)
lcDisabledPicture = Addbs(_Screen.ThemesManager.TempFolder) + ;
Juststem(lcPicture) + "_Disabled." + Justext(lcPicture)
Endif
llCreateDisabledPicture = Not File(lcDisabledPicture)
If llCreateDisabledPicture
.CreateAdditionalImages(lcPicture,"",;
Iif(llCreateDisabledPicture,lcDisabledPicture,""),;
"")
Endif
*
Local lcClassLibrary, loParent, lnTop
lcClassLibrary = "ZoomNavBar.vcx"
loParent = Evaluate("This.cntZoom."+lcParent)
If Not Vartype(loParent.Stack)=="O"
Local lcStackName
lcStackName = "Stack_"+loParent.Name
Thisform.Newobject(lcStackName,"StackContainer",lcClassLibrary)
loParent.Stack = Evaluate("Thisform."+lcStackName)
Endif
lnTop = ((loParent.Stack.ControlCount-1)*36)
loParent.Stack.Newobject(lcName,"StackButton",lcClassLibrary,,;
lcCaption,lcPicture,lcDisabledPicture,llCreateDisabledPicture,llEnabled,lnTop)
loParent.Stack.Controls(loParent.Stack.ControlCount).ChangeTheme()
*
Local lnHeight, loStackButton
lnHeight = 0
For Each loStackButton In loParent.Stack.Controls
With loStackButton
If Upper(loStackButton.Class)=="STACKBUTTON"
lnHeight = lnHeight + .Height
.Left = loParent.Stack.Width - .Width
Endif
Endwith
Endfor
loParent.Stack.Height = lnHeight
*
Store Null To loStackButton, loParent
Endif
Endif
ENDPROC
PROCEDURE buttonclicked && Occurs when a button is clicked.
Lparameters lcName
ENDPROC
PROCEDURE changetheme && Internal to the class. Occurs when theme change.
With This.imgBackground
.BorderColor = _Screen.ThemesManager.GetMember("Container.BorderColor")
.Picture = _Screen.ThemesManager.GetMember("ZoomNavBar.Bar.Picture")
Endwith
ENDPROC
PROCEDURE createadditionalimages && Internal to the class. Create necessary images to achieve the effects.
Lparameters lcPicture, lcReflectedPicture, ;
lcDisabledPicture, lcDisabledReflectedPicture
If Not Vartype(_Screen.System)=="O"
Do System.App && Init GDIPlusX
Endif
Local loBitmap As xfcBitmap, loClrMatrix As xfcColorMatrix
With _Screen.System.Drawing
If Not Empty(lcReflectedPicture) Or Not Empty(lcDisabledReflectedPicture)
loBitmap = .Bitmap.New(lcPicture)
loBitmap.RotateFlip(.RotateFlipType.Rotate180FlipX)
loClrMatrix = .Imaging.ColorMatrix.New()
loClrMatrix.Matrix33 = 0.3
loBitmap.ApplyColorMatrix(loClrMatrix)
If Not Empty(lcReflectedPicture)
loBitmap.Save(lcReflectedPicture,.Imaging.ImageFormat.Png)
Endif
If Not Empty(lcDisabledReflectedPicture)
loClrMatrix = _Screen.System.Drawing.Imaging.ColorMatrix.New( ;
.299, .299, .299, 0, 0, ;
.587, .587, .587, 0, 0, ;
.114, .114, .114, 0, 0, ;
0 , 0, 0, 1, 0, ;
0 , 0, 0, 0, 1)
loBitmap.ApplyColorMatrix(loClrMatrix)
loBitmap.Save(lcDisabledReflectedPicture,.Imaging.ImageFormat.Png)
Endif
Endif
*
If Not Empty(lcDisabledPicture)
loBitmap = .Bitmap.New(lcPicture)
loClrMatrix = _Screen.System.Drawing.Imaging.ColorMatrix.New( ;
.299, .299, .299, 0, 0, ;
.587, .587, .587, 0, 0, ;
.114, .114, .114, 0, 0, ;
0 , 0, 0, 1, 0, ;
0 , 0, 0, 0, 1)
loBitmap.ApplyColorMatrix(loClrMatrix)
loBitmap.Save(lcDisabledPicture,.Imaging.ImageFormat.Png)
Endif
*
Endwith
Store Null To loBitmap, loClrMatrix
ENDPROC
PROCEDURE Init
Thisform.ShowTips = .T.
This.InitThemedControl()
ENDPROC
HIDDEN PROCEDURE initthemedcontrol && Internal to the class.
If Not Vartype(_Screen.ThemesManager)=="O"
_Screen.Newobject("ThemesManager","ThemesManager","ThemedControls.vcx")
Endif
This.ChangeTheme()
ENDPROC
PROCEDURE rearrangebuttons && Internal to the class. Rearrange buttons to show in correctly position.
Local lnActiveButton
lnActiveButton = This.ActiveButtonNumber
With This.cntZoom
Local lnControlCount, lnZoomOffset, lnLeft, lnButton, lnWidth
lnControlCount = .ControlCount
If lnActiveButton==0
lnZoomOffset = 0
Else
lnZoomOffset = 48
If lnActiveButton>1 And Not ;
Upper(.Controls(lnActiveButton-1).Class)=="SEPARATORIMAGE"
lnZoomOffset = lnZoomOffset + 24
Endif
If lnActiveButton<lnControlCount And Not ;
Upper(.Controls(lnActiveButton+1).Class)=="SEPARATORIMAGE"
lnZoomOffset = lnZoomOffset + 24
Endif
Endif
lnLeft = Max(0,Int((.Width - (lnControlCount*48) - lnZoomOffset)/2))
For lnButton = 1 To lnControlCount
With .Controls(lnButton)
If Vartype(.Stack)=="O"
.Stack.Visible = .F.
Endif
Store lnLeft To .Left, ;
This.cntReflected.Controls(lnButton).Left
If lnActiveButton>0 And ;
lnActiveButton==.ImageID
.Top = 0
lnWidth = 96
Else
If Not Upper(.Class)=="SEPARATORIMAGE" And ;
lnActiveButton>0 And ;
Inlist(.ImageID,lnActiveButton-1,;
lnActiveButton+1)
.Top = 24
lnWidth = 72
Else
.Top = 48
lnWidth = 48
Endif
Endif
Store lnWidth To .Height, .Width, ;
This.cntReflected.Controls(lnButton).Height, ;
This.cntReflected.Controls(lnButton).Width
lnLeft = lnLeft + lnWidth
Endwith
Next
*
If Not This.Stretch And lnControlCount>0
With This.cntZoom
This.imgBackground.Left = .Controls(1).Left - 6
This.imgBackground.Width = (.Controls(lnControlCount).Left + ;
.Controls(lnControlCount).Width) - This.imgBackground.Left + 6
Endwith
Endif
Endwith
ENDPROC
PROCEDURE Resize
DoDefault()
With This
.shpMouseHandler.Width = .Width
.cntZoom.Width = .Width
.cntReflected.Width = .Width
If .Stretch
.imgBackground.Width = .Width
Endif
.ReArrangeButtons()
Endwith
ENDPROC
PROCEDURE setbuttonstate && Set the button state: enabled or disabled.
Lparameters lcButton, llEnabled
Store llEnabled To ;
This.cntZoom.&lcButton..Enabled, ;
This.cntReflected.&lcButton..Enabled
ENDPROC
PROCEDURE setstackbuttonstate && Set the stack button state: enabled or disabled.
Lparameters lcButton, lcStackButton, llEnabled
This.cntZoom.&lcButton..Stack.&lcStackButton..Enabled = llEnabled
ENDPROC
PROCEDURE stackbuttonclicked && Occurs when a stack button is clicked.
Lparameters lcName
ENDPROC
PROCEDURE imgBackground.Init
This.Height = 50
ENDPROC
PROCEDURE shpMouseHandler.MouseEnter
Lparameters nButton, nShift, nXCoord, nYCoord
With This.Parent
If Not .ActiveButtonName = "None"
.ActiveButtonName = "None"
.ActiveButtonNumber = 0
.RearrangeButtons()
Endif
Endwith
ENDPROC
ENDDEFINE