Jump to content

Delete XSkinButton


 Share

Recommended Posts

Ok what I have is two menus one on top and one on bottom what I can't get is so that when a button on top is clicked the submenu (bottom menu) is deleted to make room for the new submenu.

$xGui = SkinGuiCreate('', $gWidth, $gHeight, 0, 0, $xSkin, 1, 25, 0)
GUISetState()
;Top Row Buttons
$gTopMenu[2] = XSkinButton('Images', ($gButton1Y * 9.5), $gButton1Y, $gButtonW, $gButtonH, 'PageChangeImages')
Sleep($gAnimationTime)
$gTopMenu[4] = XSkinButton('Internet', ($gButton1Y * 11), $gButton1Y, $gButtonW, $gButtonH, 'PageChangeInternet')
Sleep($gAnimationTime)
$gTopMenu[3] = XSkinButton('Games', ($gButton1Y * 8), $gButton1Y, $gButtonW, $gButtonH, 'PageChangeGames')
Sleep($gAnimationTime)
$gTopMenu[5] = XSkinButton('Settings', ($gButton1Y * 12.5), $gButton1Y, $gButtonW, $gButtonH, 'PageChangeSettings')
Sleep($gAnimationTime)
$gTopMenu[1] = XSkinButton('Audio', ($gButton1Y * 6.5), $gButton1Y, $gButtonW, $gButtonH, 'PageChangeAudio')
Sleep($gAnimationTime)
$gTopMenu[6] = XSkinButton('Shutdown', ($gButton1Y * 14), $gButton1Y, $gButtonW, $gButtonH, 'PageChangeShutdown')
Sleep($gAnimationTime)
$gTopMenu[0] = XSkinButton('Video', ($gButton1Y * 5), $gButton1Y, $gButtonW, $gButtonH, 'PageChangeVideo')
While 1
MouseOver()
Sleep(100)
WEnd

Func PageChange($xButton)
_ClearMenu(1)
Switch $xButton
  Case 'Images'
   $gBottomMenu[4] = XSkinButton('Design', ($gButton1Y * 10), @DesktopHeight - (2 * $gButton1Y), $gButtonW, $gButtonH, 'PageChangeDesign')
   Sleep($gAnimationTime)
   $gBottomMenu[3] = XSkinButton('Import/Export', ($gButton1Y * 8.5), @DesktopHeight - (2 * $gButton1Y), $gButtonW, $gButtonH, 'PageChangeIE')
   Sleep($gAnimationTime)
   $gBottomMenu[5] = XSkinButton('Find', ($gButton1Y * 11.5), @DesktopHeight - (2 * $gButton1Y), $gButtonW, $gButtonH, 'PageChangeFind')
   Sleep($gAnimationTime)
   $gBottomMenu[1] = XSkinButton('View', ($gButton1Y * 7), @DesktopHeight - (2 * $gButton1Y), $gButtonW, $gButtonH, 'PageChangeView')
  Case 'Internet'
   Sleep(10
  Case 'Shutdown'
   _Shutdown()
EndSwitch
EndFunc   ;==>PageChange
Func _ClearPage($iMenu = 1)
For $i = 1 To 5
  GuiCtrlDelete($gBottomMenu[$i])
Next
EndFunc
Func _Shutdown()
Exit
EndFunc   ;==>_Shutdown

I removed a lot of the script as it would take awhile to attach all my includes anyway but this is where I'm having trouble, I want it so that when _ClearPage is called it will delete any button listed in the $gBottomMenu array.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...