* * *    
Главная » Статьи » Код PB

Просмотров: 1344 | Дата: 28.03.2024 | Коментарии (0)

Меню с права




Code
Enumeration
  #Window_0
EndEnumeration
Enumeration
  #Menu_Window_0
EndEnumeration
Enumeration
  #Menu_Window_0_Item1
  #Menu_Window_0_Item2
  #Menu_Window_0_Item3
EndEnumeration
Procedure MenuTitleRight(hWindow.l, hMenu.l, MenuIndex.l) ; Not working on NT4
  Protected ThisMenuItemInfo.MENUITEMINFO
  ThisMenuItemInfo\cbSize = SizeOf(MENUITEMINFO)
  ThisMenuItemInfo\fMask = #MIIM_FTYPE
  GetMenuItemInfo_(hMenu, MenuIndex, #True, ThisMenuItemInfo)  
  ThisMenuItemInfo\fType = ThisMenuItemInfo\fType | #MFT_RIGHTJUSTIFY
  SetMenuItemInfo_(hMenu, MenuIndex, #True, ThisMenuItemInfo)
  DrawMenuBar_(hWindow)
EndProcedure
If OpenWindow(#Window_0, 450, 200, 400, 419, "MenuTitleRight", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
  If CreateMenu(#Menu_Window_0, WindowID(#Window_0))
  MenuTitle("Title 1") ; 0
  MenuItem(#Menu_Window_0_Item1, "Item 1")
  MenuItem(#Menu_Window_0_Item2, "Item 2")
  MenuTitle("Title 2") ; 1
  MenuItem(#Menu_Window_0_Item3, "Item 3")
  ;
  MenuTitleRight(WindowID(#Window_0), MenuID(#Menu_Window_0), 1)
  ;
  Repeat
  Event = WaitWindowEvent()
  Select Event
  Case #PB_Event_CloseWindow
  Break
  EndSelect
  ForEver
  EndIf
EndIf










Сайт посвящён языку программирования PureBasic — коммерческий компилятор языка программирования, использующего синтаксис BASIC. Предназначен для создания кроссплатформенных приложений для AmigaOS, Linux, Microsoft Windows, Windows NT и Mac OS X. Разработан компанией Fantaisie Software.