Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Page Menu Control UDC


  • Please log in to reply
11 replies to this topic

#1 Aipion

Aipion

    Polymath

  • Banned (NOT IN USE)
  • 200 posts

Posted 03 July 2011 - 01:23 AM

A page menu contains grouped lists of conceptually related pages (In AutoIt they don't have pages therefore it is windows that can be shown) or links.
The Page Menu enables the end-user to hide items and to reopen them.

This Page Menu Control UDC is a control made up of other controls in AutoIt e.g labels,Pics and icons. The groups buttons are not actual buttons but they were made by the use of "GUICtrlOnHover.au3" UDF and the same goes for the HyperLinks. The only difference between the real Page Menu control and this control is that it does not create Pages(form) nor it has a scroll bar when the groups go off the background image.(I did not make the control in a different gui and then add it with a scroll bar, because it will not re-size when the parent window has been re-sized therefore it would have to be done manually)

This UDC has functions to update the Page Menu whenever you want to update it. I have also added "PageMenu_LoadInterfaceImages" function to enable customization of the skin, which means you can have different skins for each control that you create.

Works on x86 bit and x64 bit systems.

UDFs required:
GUICtrlOnHover.au3
Icons.au3

Script Function:
PageMenu_Create
PageMenu_LoadInterfaceImages
PageMenu_AddGroup
PageMenu_GetHandleOfGroupButton
PageMenu_GetHandleOfControlsWindow
PageMenu_GetHandleOfControlsBK
PageMenu_DeleteItem
PageMenu_AddItem
PageMenu_GetGroupItemCount
PageMenu_GetGroupCount
PageMenu_Destroy
PageMenu_DeleteGroup


How the Page Menu looks like.
Posted Image

Attached File  Page Menu UDC.zip   780.31KB   202 downloads
Previous Downloads:32

To create your own Skins.
Download Skins PSDs

Edited by Aipion, 13 February 2012 - 11:31 PM.








#2 monoscout999

monoscout999

    a member

  • Active Members
  • PipPipPipPipPipPip
  • 1,064 posts

Posted 03 July 2011 - 02:13 AM

this look very nice... i will use for sure. grat job! :)
eemm when i run the example i have the follow errors... if i run it anyway it works...
Plain Text         
>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\Agustin\autoit\page menu\Example.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams     +>23:14:29 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:0C0A  Keyboard:0000040A  OS:WIN_7/  CPU:X64 OS:X64) >Running AU3Check (1.54.19.0)  from:C:\Program Files (x86)\AutoIt3 G:\Agustin\autoit\page menu\Page Menu UDC.au3(259,72) : WARNING: $GUI_BKCOLOR_TRANSPARENT: possibly used before declaration.             GUICtrlSetBkColor($PGM_GroupItem_ControlID, $GUI_BKCOLOR_TRANSPARENT)             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(260,63) : WARNING: $GUI_DOCKLEFT: possibly used before declaration.             GUICtrlSetResizing($PGM_GroupItem_ControlID, $GUI_DOCKLEFT +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(260,78) : WARNING: $GUI_DOCKTOP: possibly used before declaration.             GUICtrlSetResizing($PGM_GroupItem_ControlID, $GUI_DOCKLEFT + $GUI_DOCKTOP +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(260,93) : WARNING: $GUI_DOCKSIZE: possibly used before declaration.             GUICtrlSetResizing($PGM_GroupItem_ControlID, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKSIZE)             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(448,60) : WARNING: $GUI_DOCKBOTTOM: possibly used before declaration.             GUICtrlSetResizing( $PageMenuUDFBKImage, $GUI_DOCKBOTTOM+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(448,91) : WARNING: $GUI_DOCKMENUBAR: possibly used before declaration.             GUICtrlSetResizing( $PageMenuUDFBKImage, $GUI_DOCKBOTTOM+$GUI_DOCKLEFT+$GUI_DOCKMENUBAR+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(448,106) : WARNING: $GUI_DOCKWIDTH: possibly used before declaration.             GUICtrlSetResizing( $PageMenuUDFBKImage, $GUI_DOCKBOTTOM+$GUI_DOCKLEFT+$GUI_DOCKMENUBAR+$GUI_DOCKWIDTH)             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(453,53) : WARNING: $GUI_DISABLE: possibly used before declaration.         GUICtrlSetState($PageMenuUDFBKImage , $GUI_DISABLE)         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(776,50) : WARNING: $GUI_SHOW: possibly used before declaration.                 GUICtrlSetState(Number($Temp4[$IZ]),$GUI_SHOW)                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(810,50) : WARNING: $GUI_HIDE: possibly used before declaration.                 GUICtrlSetState(Number($Temp4[$IZ]),$GUI_HIDE)                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Example.au3(73,21) : WARNING: $Cr1_G1_item1: possibly used before declaration.         Case $Cr1_G1_item1         ~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Example.au3(73,21) : ERROR: $Cr1_G1_item1: undeclared global variable.         Case $Cr1_G1_item1         ~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Example.au3 - 1 error(s), 11 warning(s) !>23:14:29 AU3Check ended.rc:2 >Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "G:\Agustin\autoit\page menu\Example.au3"     +>23:14:37 AutoIT3.exe ended.rc:0 >Exit code: 0    Time: 9.571

the strange thing is that the necesary inludes are there ;)

Edited by monoscout999, 03 July 2011 - 02:15 AM.


#3 twitchyliquid64

twitchyliquid64

    Peace. Always.

  • Active Members
  • PipPipPipPipPipPip
  • 527 posts

Posted 03 July 2011 - 02:15 AM

What can I say?

I like.
ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

#4 Aipion

Aipion

    Polymath

  • Banned (NOT IN USE)
  • 200 posts

Posted 03 July 2011 - 02:41 AM

this look very nice... i will use for sure. grat job! :)
eemm when i run the example i have the follow errors... if i run it anyway it works...

Plain Text         
>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\Agustin\autoit\page menu\Example.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams     +>23:14:29 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:0C0A  Keyboard:0000040A  OS:WIN_7/  CPU:X64 OS:X64) >Running AU3Check (1.54.19.0)  from:C:\Program Files (x86)\AutoIt3 G:\Agustin\autoit\page menu\Page Menu UDC.au3(259,72) : WARNING: $GUI_BKCOLOR_TRANSPARENT: possibly used before declaration.             GUICtrlSetBkColor($PGM_GroupItem_ControlID, $GUI_BKCOLOR_TRANSPARENT)             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(260,63) : WARNING: $GUI_DOCKLEFT: possibly used before declaration.             GUICtrlSetResizing($PGM_GroupItem_ControlID, $GUI_DOCKLEFT +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(260,78) : WARNING: $GUI_DOCKTOP: possibly used before declaration.             GUICtrlSetResizing($PGM_GroupItem_ControlID, $GUI_DOCKLEFT + $GUI_DOCKTOP +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(260,93) : WARNING: $GUI_DOCKSIZE: possibly used before declaration.             GUICtrlSetResizing($PGM_GroupItem_ControlID, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKSIZE)             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(448,60) : WARNING: $GUI_DOCKBOTTOM: possibly used before declaration.             GUICtrlSetResizing( $PageMenuUDFBKImage, $GUI_DOCKBOTTOM+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(448,91) : WARNING: $GUI_DOCKMENUBAR: possibly used before declaration.             GUICtrlSetResizing( $PageMenuUDFBKImage, $GUI_DOCKBOTTOM+$GUI_DOCKLEFT+$GUI_DOCKMENUBAR+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(448,106) : WARNING: $GUI_DOCKWIDTH: possibly used before declaration.             GUICtrlSetResizing( $PageMenuUDFBKImage, $GUI_DOCKBOTTOM+$GUI_DOCKLEFT+$GUI_DOCKMENUBAR+$GUI_DOCKWIDTH)             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(453,53) : WARNING: $GUI_DISABLE: possibly used before declaration.         GUICtrlSetState($PageMenuUDFBKImage , $GUI_DISABLE)         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(776,50) : WARNING: $GUI_SHOW: possibly used before declaration.                 GUICtrlSetState(Number($Temp4[$IZ]),$GUI_SHOW)                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Page Menu UDC.au3(810,50) : WARNING: $GUI_HIDE: possibly used before declaration.                 GUICtrlSetState(Number($Temp4[$IZ]),$GUI_HIDE)                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Example.au3(73,21) : WARNING: $Cr1_G1_item1: possibly used before declaration.         Case $Cr1_G1_item1         ~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Example.au3(73,21) : ERROR: $Cr1_G1_item1: undeclared global variable.         Case $Cr1_G1_item1         ~~~~~~~~~~~~~~~~~~^ G:\Agustin\autoit\page menu\Example.au3 - 1 error(s), 11 warning(s) !>23:14:29 AU3Check ended.rc:2 >Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "G:\Agustin\autoit\page menu\Example.au3"     +>23:14:37 AutoIT3.exe ended.rc:0 >Exit code: 0    Time: 9.571

the strange thing is that the necesary inludes are there ;)



Thanks,

Fixed the issues.

Edited by Antop, 03 July 2011 - 07:56 PM.


#5 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,313 posts

Posted 03 July 2011 - 10:25 AM

This is very nice Antop, 4 stars from me.

The text in the MsBox's seems to be wrong which is confusing.

It would be useful to have

PageMen_GroupSetVisible
PageMenu_ItemSetVisible
PageMenu_ItemSetEnabled

so that options can be shown or not depending on circumstances without needing to destroy and recreate them.

I find it a bit awkward that you have used assign for the items rather than use an array. It means that to work out the ID of an item you would have to reconstruct the ID name and use Eval if you were building the PageMenus at run time or in a loop. I would prefer that AddItem returned the ID on success and 0 on failure, and an option for some way to return an array of the ID's for a group, but I expect I am being fussy. It could also prevent the warnings about undeclared variables which I don't like.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#6 Aipion

Aipion

    Polymath

  • Banned (NOT IN USE)
  • 200 posts

Posted 03 July 2011 - 01:29 PM

This is very nice Antop, 4 stars from me.

The text in the MsBox's seems to be wrong which is confusing.

It would be useful to have

PageMen_GroupSetVisible
PageMenu_ItemSetVisible
PageMenu_ItemSetEnabled

so that options can be shown or not depending on circumstances without needing to destroy and recreate them.

I find it a bit awkward that you have used assign for the items rather than use an array. It means that to work out the ID of an item you would have to reconstruct the ID name and use Eval if you were building the PageMenus at run time or in a loop. I would prefer that AddItem returned the ID on success and 0 on failure, and an option for some way to return an array of the ID's for a group, but I expect I am being fussy. It could also prevent the warnings about undeclared variables which I don't like.


Thanks,

I changed it to what you told but I will consider doing the functions that you noted above at a later point.

#7 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,313 posts

Posted 03 July 2011 - 05:33 PM

Thanks,

I changed it to what you told but I will consider doing the functions that you noted above at a later point.

Thanks, I like the changes you made; I think it makes the UDF easier to use.

But the message boxes still have incorrect text I think.

"Adding Item to PageMenu Control 2 at Group Index 4"
should be
"Adding Item to PageMenu control 2 Group Index 1"

"Deleting Item of PageMenu Control 2 at Group index 2"
should be
"Deleting PageMenu Control 2 Group 3"

Edited by martin, 03 July 2011 - 06:02 PM.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#8 Aipion

Aipion

    Polymath

  • Banned (NOT IN USE)
  • 200 posts

Posted 03 July 2011 - 07:49 PM

Thanks, I like the changes you made; I think it makes the UDF easier to use.

But the message boxes still have incorrect text I think.

"Adding Item to PageMenu Control 2 at Group Index 4"
should be
"Adding Item to PageMenu control 2 Group Index 1"

"Deleting Item of PageMenu Control 2 at Group index 2"
should be
"Deleting PageMenu Control 2 Group 3"


Thanks you for indicating about the the error, the thing was that i changed it to different indexes in the function but forgot to update the message boxes indexes too.
I also created a new skin and it is included in the example.

Edited by Antop, 03 July 2011 - 07:58 PM.


#9 monoscout999

monoscout999

    a member

  • Active Members
  • PipPipPipPipPipPip
  • 1,064 posts

Posted 03 July 2011 - 08:08 PM

If when i run the example and do a click in the button "Delete PageMenu Control 2" and then try to collapse any of the groups from the control 1, i have the followed error.
G:\Agustin\autoit\page menu\Page Menu UDC.au3 (853) : ==> Subscript used with non-Array variable.: If $Temp2[3] = 1 Then If $Temp2^ ERROR ->17:06:40 AutoIT3.exe ended.rc:1 >Exit code: 1    Time: 9.062

Edited by monoscout999, 03 July 2011 - 08:11 PM.


#10 Aipion

Aipion

    Polymath

  • Banned (NOT IN USE)
  • 200 posts

Posted 03 July 2011 - 08:54 PM

If when i run the example and do a click in the button "Delete PageMenu Control 2" and then try to collapse any of the groups from the control 1, i have the followed error.

G:\Agustin\autoit\page menu\Page Menu UDC.au3 (853) : ==> Subscript used with non-Array variable.: If $Temp2[3] = 1 Then If $Temp2^ ERROR ->17:06:40 AutoIT3.exe ended.rc:1 >Exit code: 1    Time: 9.062

Fixed the issue, it was just the case of a bug where i was meant to put 1 but instead i had $PageMenuUDF_FullData[$Temp1[0]][1].

You and martin have been a real help in getting this project fixed.

#11 monoscout999

monoscout999

    a member

  • Active Members
  • PipPipPipPipPipPip
  • 1,064 posts

Posted 03 July 2011 - 09:11 PM

Fixed the issue, it was just the case of a bug where i was meant to put 1 but instead i had $PageMenuUDF_FullData[$Temp1[0]][1].

You and martin have been a real help in getting this project fixed.

I found the project intersting, also i`m thinking in do the skins by Script using _winapi_gradientfill() included in WinAPIEx.au3

#12 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,251 posts

Posted 05 July 2011 - 01:54 AM

Very good, i glad to see my GUIOnHover udf used in there :)
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users