PureBasic - форум

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.



SpinGadget

Сообщений 31 страница 39 из 39

31

Тогда нужно где-то хранить цвет каждой строки (например в SetGadgetItemData()) и раскрашивать все строки требуемым цветом.

0

32

что то с размерами не разберусь

Код:
UsePNGImageDecoder()
  Global top=45
Global  PropertisWindow,PropertisWindowX,PropertisWindowY,PropertisWindowWidth,PropertisWindowHeight
Global PanelX, PanelY, PanelW, PanelH
;XIncludeFile "#PropertisWindowGadget.pb" 
Enumeration #PB_Compiler_EnumerationValue
  #PropertisWindow
  #PropertisWindowListIcon
  #PropertisWindowComboBox
  #PropertisWindowComboBox_
  #PropertisWindowComboBox_1
  #PropertisWindowSpin
  #PropertisWindowButtonImage
  #PropertisWindowString
  #PropertisWindowListIcon_
  #Splitter
  #PropertisWindowScrollArea
  
  
EndEnumeration


#LVM_SUBITEMHITTEST = #LVM_FIRST + 57 
#LVM_GETSUBITEMRECT = #LVM_FIRST + 56 

Global oldproc 
Global currentitem, currentsubitem 

; ------------------------------
;{- SpinGadget_
; ------------------------------
Declare ResizeSpinGadget_(Gadget,left,top,width,heigth)
Declare HideSpinGadget_(Gadget,param)

Procedure SpinGadget_(Gadget,left,top,width,heigth,min,max,pos=0,textpos=2 )
 Global SpinGadget_,SpinGadget_String,SpinGadget_UpDown
  UpDownWidth =18
  SpinGadget_  =ContainerGadget(#PB_Any ,0,0,0,0); ,#PB_Container_Flat
  SpinGadget_String =StringGadget(Gadget,0,0,0,0,"",textpos|#PB_String_Numeric)
  SetParent_(GadgetID(Gadget),GadgetID(SpinGadget_)) 

  SpinGadget_UpDown =  CreateUpDownControl_(#WS_CHILD|#WS_VISIBLE|#UDS_SETBUDDYINT|#UDS_ARROWKEYS,0,0,0,0,GadgetID(SpinGadget_),1,GetModuleHandle_(0),GadgetID(Gadget),max,min,pos)
  CloseGadgetList()
  ResizeSpinGadget_(Gadget,0,0,100,20)
  If Gadget=#PB_Any
    ProcedureReturn SpinGadget_String
  EndIf  
EndProcedure 

Procedure ResizeSpinGadget_(Gadget,left,top,width,heigth)
  UpDownWidth =17
  ResizeGadget(SpinGadget_ ,left,top,width,heigth)
  ResizeGadget(gadget ,0,1,width-UpDownWidth,heigth-1)
  MoveWindow_(SpinGadget_UpDown,GadgetWidth(gadget),0,UpDownWidth,heigth+1,1)
     
EndProcedure

Procedure HideSpinGadget_(Gadget,param)
  If param =1
    param=0
  Else
    param=1
  EndIf  
    
  ShowWindow_(GadgetID(SpinGadget_),param)  
  ShowWindow_(GadgetID(Gadget),param)  
  ShowWindow_(SpinGadget_UpDown,param)  
  
EndProcedure
;}------------------------------
; ------------------------------


Procedure.l PropertisWindowCallback(hWindow, iMessage, wParam, lParam)
  Protected Result,PWindowX,PWindowY,PWindowWidth,PWindowHeight
  
       PropertisWindowX=WindowX(#PropertisWindow)
       PropertisWindowY=WindowY(#PropertisWindow)
   PropertisWindowWidth=WindowWidth(#PropertisWindow)
  PropertisWindowHeight=WindowHeight(#PropertisWindow)

 
  Select iMessage
      
    Case 799  
      
    Case #WM_SIZE,#WM_MOVE
      If MainWindow=1 ; если запустили от главного окна
        ResizeWindow(#PropertisWindow,MainWindowX+MainWindowWidth-PropertisWindowWidth-3,MainWindowY+(MenuWindowHeight*2-6),#PB_Ignore,MainWindowHeight-MenuWindowHeight*2+3) 
      EndIf  
      h =731
       RedrawWindow_(WindowID(#PropertisWindow), 0, 0, #RDW_UPDATENOW|#RDW_ALLCHILDREN) ; с начало убирает мерцание Окна
       RedrawWindow_(GadgetID(#PropertisWindowScrollArea), 0, 0, #RDW_UPDATENOW|#RDW_ALLCHILDREN) ; с начало убирает мерцание Окна
       
       ResizeGadget(#PropertisWindowScrollArea,3,3, PropertisWindowWidth-6,PropertisWindowHeight-6) 
       ResizeGadget(#Splitter,#PB_Ignore,#PB_Ignore, GadgetWidth(#PropertisWindowScrollArea)-15,h+2) 
       SetGadgetAttribute(#PropertisWindowScrollArea, #PB_ScrollArea_InnerWidth, GadgetWidth(#PropertisWindowScrollArea)-19)
       SetGadgetAttribute(#PropertisWindowScrollArea, #PB_ScrollArea_InnerHeight, h)
       SetGadgetItemAttribute(#PropertisWindowListIcon_, 0,#PB_ListIcon_ColumnWidth , GadgetWidth(#PropertisWindowListIcon_)-4,0)
       
       
       ;InvalidateRect_(GadgetID(#PropertisWindowScrollArea),0,1)
       
       ;ResizeGadget(#PropertisWindowListIcon_,#PB_Ignore,#PB_Ignore, GadgetWidth(#ContainerTOP),GadgetHeight(#Container)) 
       ResizeGadget(#PropertisWindowListIcon,#PB_Ignore,#PB_Ignore, 66,#PB_Ignore) 
      
        SetGadgetItemAttribute(#PropertisWindowListIcon, 0,#PB_ListIcon_ColumnWidth , GadgetWidth(#PropertisWindowListIcon)-4,0)
       
       
    Case #WM_DRAWITEM 
      
      *lpdis.DRAWITEMSTRUCT = lparam 
      Dim itemrect.RECT(3) 
      For i = 0 To 3 
        RtlZeroMemory_(@itemrect(i),SizeOf(RECT)) 
        itemrect(i)\top = i 
        SendMessage_(*lpdis\hwndItem, #LVM_GETSUBITEMRECT, *lpdis\itemid, @itemrect(i)) 
        text$ = GetGadgetItemText(GetDlgCtrlID_(*lpdis\hwndItem), *lpdis\itemid, i) 
        
        If *lpdis\itemid=1 Or *lpdis\itemid=6 Or *lpdis\itemid=11 Or *lpdis\itemid=26
          hpen = CreatePen_(#PS_SOLID, 1, $D0D0D0); цвет рамки
          WhiteBrush = CreateSolidBrush_($D0D0D0) ; цвет строки
        Else
          hpen = CreatePen_(#PS_SOLID, 1, RGB(114, 151, 203)); цвет рамки
          WhiteBrush = GetStockObject_(#HOLLOW_BRUSH) ; Прозрачная кисть.
          ;WhiteBrush = CreateSolidBrush_($00FFFF) ; цвет строк
        EndIf
        
        SetBkMode_(*lpdis\hDC, #TRANSPARENT) ;убрать белый фон
        SelectObject_(*lpdis\hDC, hpen);
        ;SelectObject_(*lpdis\hDC, GetStockObject_(#NULL_PEN)) ; убрать рамку вокруг строки
        
        SelectObject_(*lpdis\hDC, WhiteBrush) 
        Rectangle_(*lpdis\hDC, itemrect(i)\left+1, itemrect(i)\top+1, itemrect(i)\right, itemrect(i)\bottom) 
        
        TextOut_(*lpdis\hDC, itemrect(i)\left+4, itemrect(i)\top+5, text$, Len(text$)) 

        DeleteObject_(hpen)
        DeleteObject_(WhiteBrush) 
      Next

    Case #WM_MEASUREITEM 
    
      *lpmis.MEASUREITEMSTRUCT = lparam 
      *lpmis\itemheight = 22 
              
       
     Default
      
    Result = #PB_ProcessPureBasicEvents  
  EndSelect
 ProcedureReturn Result
EndProcedure

Procedure Resize(hwnd)
  RtlZeroMemory_(@itemrect.RECT,SizeOf(RECT)) 
  itemrect\top = currentsubitem 
  SendMessage_(hwnd,#LVM_GETSUBITEMRECT, currentitem, @itemrect)       
  ResizeGadget(#PropertisWindowComboBox,itemrect\left+1,itemrect\top+2,itemrect\right-itemrect\left-2,itemrect\bottom-itemrect\top-1)
  ResizeSpinGadget_(#PropertisWindowSpin, itemrect\left+1,itemrect\top+1,itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top) 
  InvalidateRect_(GadgetID(#PropertisWindowComboBox),0,1)
  InvalidateRect_(GadgetID(#PropertisWindowSpin),0,1)
  
EndProcedure

Procedure SubClass_LV(hwnd, msg, wparam, lparam) 
  result = CallWindowProc_(oldproc, hwnd, msg, wparam, lparam) 
  
  If msg = #WM_RBUTTONDOWN Or msg = #WM_LBUTTONDOWN ;Or msg = #WM_CREATE
    GetCursorPos_(@cp.POINT) 
    MapWindowPoints_(0,hwnd,@cp,1) 
    HitInfo.LVHITTESTINFO 
    Hitinfo\pt\x = cp\x 
    HitInfo\pt\y = cp\y 
    SendMessage_(hwnd,#LVM_SUBITEMHITTEST ,0,@HitInfo) 
    If hitinfo\isubitem = 1 And HitInfo\iItem >= 0 ;если шелкнули по 1 стольбцу
       currentitem    = hitinfo\iitem 
       currentsubitem = hitinfo\isubitem+1 
       RtlZeroMemory_(@itemrect.RECT,SizeOf(RECT)) 
       itemrect\top = hitinfo\iSubItem+1 
       SendMessage_(hwnd,#LVM_GETSUBITEMRECT, hitinfo\iitem, @itemrect) 
    
      
     ElseIf hitinfo\isubitem = 0 And HitInfo\iItem >= 0 ;если шелкнули по 2 стольбцу
      currentitem    = hitinfo\iitem 
      currentsubitem = hitinfo\isubitem 
      RtlZeroMemory_(@itemrect.RECT,SizeOf(RECT)) 
      itemrect\top = hitinfo\iSubItem 
      SendMessage_(hwnd,#LVM_GETSUBITEMRECT, hitinfo\iitem, @itemrect) 
      
       ;StringGadget
      If currentitem =0 Or currentitem =12
        ResizeGadget(#PropertisWindowString, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(#PropertisWindowString,GetGadgetItemText(#PropertisWindowListIcon,currentitem,currentsubitem))
        SetFocus_(GadgetID(#PropertisWindowString))
        HideGadget(#PropertisWindowString,0) 
        HideSpinGadget_(#PropertisWindowSpin,1) 
        HideGadget(#PropertisWindowComboBox,1) 
        HideGadget(#PropertisWindowComboBox_,1) 
        HideGadget(#PropertisWindowComboBox_1,1) 
        HideGadget(#PropertisWindowButtonImage,1) 
        
        ElseIf currentitem =1
        ;SpinGadget
        ElseIf currentitem =2 Or currentitem =3 Or currentitem =4 Or currentitem =5
        ResizeSpinGadget_(#PropertisWindowSpin, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(#PropertisWindowSpin,GetGadgetItemText(#PropertisWindowListIcon,currentitem,currentsubitem))
        SetFocus_(GadgetID(#PropertisWindowSpin))
        HideSpinGadget_(#PropertisWindowSpin,0) 
        HideGadget(#PropertisWindowString,1) 
        HideGadget(#PropertisWindowComboBox,1) 
        HideGadget(#PropertisWindowComboBox_,1) 
        HideGadget(#PropertisWindowComboBox_1,1) 
        HideGadget(#PropertisWindowButtonImage,1) 
        
        ElseIf currentitem =6
        ;ButtonGadget
        ElseIf currentitem =7 Or currentitem =8 Or currentitem =9 Or currentitem =10 Or currentitem =21 Or currentitem =24
        ResizeGadget(#PropertisWindowButtonImage, itemrect\left+77, itemrect\top+2, itemrect\right-itemrect\left-78, itemrect\bottom-itemrect\top-3) 
        SetGadgetText(#PropertisWindowButtonImage,"...")
        SetFocus_(GadgetID(#PropertisWindowButtonImage))
        HideGadget(#PropertisWindowButtonImage,0) 
        HideGadget(#PropertisWindowString,1) 
        HideSpinGadget_(#PropertisWindowSpin,1) 
        HideGadget(#PropertisWindowComboBox,1) 
        HideGadget(#PropertisWindowComboBox_,1) 
        HideGadget(#PropertisWindowComboBox_1,1) 
         ;откючаем эти строки
        ElseIf currentitem =11
         
        ElseIf currentitem =26
        
        ;Combobox
        ElseIf currentitem =28
        ResizeGadget(#PropertisWindowComboBox_1, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(#PropertisWindowComboBox_1,GetGadgetItemText(#PropertisWindowListIcon,currentitem,currentsubitem))
        SetFocus_(GadgetID(#PropertisWindowComboBox_1))
        HideGadget(#PropertisWindowComboBox_1,0) 
        HideGadget(#PropertisWindowString,1) 
        HideSpinGadget_(#PropertisWindowSpin,1) 
        HideGadget(#PropertisWindowComboBox,1) 
        HideGadget(#PropertisWindowComboBox_,1) 
        HideGadget(#PropertisWindowButtonImage,1) 
        ;Combobox
        ElseIf currentitem =29
        ResizeGadget(#PropertisWindowComboBox_, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(#PropertisWindowComboBox_,GetGadgetItemText(#PropertisWindowListIcon,currentitem,currentsubitem))
        SetFocus_(GadgetID(#PropertisWindowComboBox_))
        HideGadget(#PropertisWindowComboBox_,0) 
        HideGadget(#PropertisWindowString,1) 
        HideSpinGadget_(#PropertisWindowSpin,1) 
        HideGadget(#PropertisWindowComboBox,1) 
        HideGadget(#PropertisWindowComboBox_1,1) 
        HideGadget(#PropertisWindowButtonImage,1) 
         
         
         
       ;ComboboxGadget 
       Else
        ResizeGadget(#PropertisWindowComboBox, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(#PropertisWindowComboBox,GetGadgetItemText(#PropertisWindowListIcon,currentitem,currentsubitem))
        SetFocus_(GadgetID(#PropertisWindowComboBox))
        HideGadget(#PropertisWindowComboBox,0) 
        HideGadget(#PropertisWindowString,1) 
        HideSpinGadget_(#PropertisWindowSpin,1) 
        HideGadget(#PropertisWindowComboBox_,1) 
        HideGadget(#PropertisWindowComboBox_1,1) 
        HideGadget(#PropertisWindowButtonImage,1) 
        
      EndIf
        
      
        
       Else 
        HideGadget(#PropertisWindowString,1) 
        HideSpinGadget_(#PropertisWindowSpin,1) 
        HideGadget(#PropertisWindowComboBox,1) 
        HideGadget(#PropertisWindowComboBox_,1) 
        HideGadget(#PropertisWindowComboBox_1,1) 
        HideGadget(#PropertisWindowButtonImage,1) 
        
        
      EndIf 
     
  ElseIf msg=#WM_HSCROLL Or msg=#WM_VSCROLL 
    Resize(hwnd)
  ElseIf msg=#WM_NOTIFY 
    *nmHEADER.HD_NOTIFY = lParam 
    Select *nmHEADER\hdr\code 
      Case #HDN_ITEMCHANGING
        Resize(hwnd)
    EndSelect 

  EndIf 
  
  ProcedureReturn result 
  
EndProcedure 

Procedure PropertisWindow()
 
 If MainWindow=0 :OpenWindow(#PropertisWindow, 0,0,200, 600, "Propertis",#PB_Window_SystemMenu|#PB_Window_Invisible|#PB_Window_ScreenCentered|#PB_Window_SizeGadget) 
   #MainWindow=0
  Else
   OpenWindow(#PropertisWindow, 0,0,185, 600, "Propertis",#PB_Window_TitleBar | #PB_Window_Invisible , WindowID(#MainWindow))
   DeleteMenu_(GetSystemMenu_(WindowID(#PropertisWindow),#False),1,#MF_BYPOSITION) ;запрешаем таскат за заголовок. 
 EndIf   
 
  ;SetWindowIcon(WindowID(#PropertisWindow),ExtractIcon_(0,"shell32.dll",130))
       PropertisWindowX=WindowX(#PropertisWindow)
       PropertisWindowY=WindowY(#PropertisWindow)
   PropertisWindowWidth=WindowWidth(#PropertisWindow)
   PropertisWindowHeight=WindowHeight(#PropertisWindow)
   
  ScrollAreaGadget(#PropertisWindowScrollArea, 0,0,0,0, 0,0,0,#PB_ScrollArea_Flat)
  
 ; ContainerGadget(#ContainerTOP, 0,0,0,0,#PB_Container_BorderLess )
  
   ListIconGadget(#PropertisWindowListIcon_, 0, 0, 0, 0, "Название", 111,#LVS_OWNERDRAWFIXED)
    SetGadgetColor(#PropertisWindowListIcon_,#PB_Gadget_BackColor, RGB(239,239,239)) ; установить цветь фона
     AddGadgetItem(#PropertisWindowListIcon_, -1, "Name" + Chr(10)) 
AddGadgetItem(#PropertisWindowListIcon_, -1, "РАЗМЕРЫ ОКНА" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Left" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Top" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Width" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Height" + Chr(10))

AddGadgetItem(#PropertisWindowListIcon_, -1, "ВИД ОКНА  " + Chr(10))

AddGadgetItem(#PropertisWindowListIcon_, -1, "BackColor" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "BackgraundImage" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "Cursor" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "Font" + Chr(10) )

AddGadgetItem(#PropertisWindowListIcon_, -1, "СТИЛЬ ОКНА  " + Chr(10)) 

AddGadgetItem(#PropertisWindowListIcon_, -1, "Caption" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Visible" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Enable" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "ControlBox" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "CloseBox" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "MaximizeBox" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "MinimizeBox" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "HelpBox" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "SizeBox" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Icon" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "ShowIcon" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "ShowInTaskbar" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "Opacity" + Chr(10) ) 
AddGadgetItem(#PropertisWindowListIcon_, -1, "RighttoLeft" + Chr(10))

AddGadgetItem(#PropertisWindowListIcon_, -1, "ПОВЕДЕНИЕ ОКНА  " + Chr(10))

AddGadgetItem(#PropertisWindowListIcon_, -1, "TopMost" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "StartPosition" + Chr(10))
AddGadgetItem(#PropertisWindowListIcon_, -1, "WindowState" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "AllowDrop" + Chr(10) )
AddGadgetItem(#PropertisWindowListIcon_, -1, "AutoScroll" + Chr(10) )



  
    ;CloseGadgetList()
   ;ContainerGadget(#ContainerBOTTOM, 0,0,0,0,#PB_Container_BorderLess )
   
   
   ListIconGadget(#PropertisWindowListIcon, 0, 0, 0, 0, "Значение", 94,#LVS_OWNERDRAWFIXED);, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_List)
    SetGadgetColor(#PropertisWindowListIcon,#PB_Gadget_BackColor, RGB(239,239,239)) ; установить цветь фона
     ;SetClassLongPtr_(GadgetID(#PropertisWindowListIcon),#GCL_HBRBACKGROUND,CreateSolidBrush_(RGB(0, 239, 0))) ; установить цветь фона
     oldproc = SetWindowLongPtr_(GadgetID(#PropertisWindowListIcon), #GWL_WNDPROC, @SubClass_LV()) 
 
     AddGadgetItem(#PropertisWindowListIcon, -1, "Window" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10) ) 

     AddGadgetItem(#PropertisWindowListIcon, -1, "5" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "5" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "350" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "200" + Chr(10)  )

     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10)  ) 

     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "Default" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10)  ) 

     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10)  ) 

     AddGadgetItem(#PropertisWindowListIcon, -1, "Window" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "False" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10)   ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "True" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "100%" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "False" + Chr(10)  ) 

     AddGadgetItem(#PropertisWindowListIcon, -1, "" + Chr(10)  ) 

     AddGadgetItem(#PropertisWindowListIcon, -1, "False" + Chr(10) ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "CenterScreen" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "Normal" + Chr(10)  ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "False" + Chr(10)   ) 
     AddGadgetItem(#PropertisWindowListIcon, -1, "False" + Chr(10) ) 


     ComboBoxGadget(#PropertisWindowComboBox, 0,0,0,0,#PB_ComboBox_Editable) 
      SetParent_(GadgetID(#PropertisWindowComboBox),GadgetID(#PropertisWindowListIcon)) 
      AddGadgetItem(#PropertisWindowComboBox,0,"True") 
      AddGadgetItem(#PropertisWindowComboBox,1,"False") 

     SpinGadget_(#PropertisWindowSpin,0, 0, 0, 0, 0, 2000,13,0)
      SetParent_(GadgetID(SpinGadget_),GadgetID(#PropertisWindowListIcon)) 
      
     StringGadget(#PropertisWindowString,0, 0, 0, 0, "")
      SetParent_(GadgetID(#PropertisWindowString),GadgetID(#PropertisWindowListIcon)) 

     ButtonImageGadget(#PropertisWindowButtonImage,0, 0, 0, 0,0)
      SetParent_(GadgetID(#PropertisWindowButtonImage),GadgetID(#PropertisWindowListIcon)) 

     ComboBoxGadget(#PropertisWindowComboBox_, 0,0,0,0,#PB_ComboBox_Editable) 
      SetParent_(GadgetID(#PropertisWindowComboBox_),GadgetID(#PropertisWindowListIcon)) 
      AddGadgetItem(#PropertisWindowComboBox_,0,"Normal") 
      AddGadgetItem(#PropertisWindowComboBox_,0,"Minimized") 
      AddGadgetItem(#PropertisWindowComboBox_,1,"Maximized") 

     ComboBoxGadget(#PropertisWindowComboBox_1, 0,0,0,0,#PB_ComboBox_Editable) 
      SetParent_(GadgetID(#PropertisWindowComboBox_1),GadgetID(#PropertisWindowListIcon)) 
      AddGadgetItem(#PropertisWindowComboBox_1,0,"CenterScreen") 
      AddGadgetItem(#PropertisWindowComboBox_1,1,"CenterParent") 
 
      
      
        HideGadget(#PropertisWindowString,1) 
        HideSpinGadget_(#PropertisWindowSpin,1) 
        HideGadget(#PropertisWindowComboBox,1) 
        HideGadget(#PropertisWindowComboBox_,1) 
        HideGadget(#PropertisWindowComboBox_1,1) 
        HideGadget(#PropertisWindowButtonImage,1) 
        
  ; CloseGadgetList()
  
    SplitterGadget(#Splitter, -1,-1,0,0, #PropertisWindowListIcon_, #PropertisWindowListIcon,#PB_Splitter_Vertical|#PB_Splitter_Separator);)
   
    
   SetGadgetAttribute(#Splitter, #PB_Splitter_FirstMinimumSize, 100) ; 1 ограничиваем минимальный размер
   SetGadgetAttribute(#Splitter, #PB_Splitter_SecondMinimumSize, 80) ; 2 ограничиваем минимальный размер
   CloseGadgetList()
  
 
  SetWindowCallback(@PropertisWindowCallback() , #PropertisWindow )
EndProcedure

Procedure Event_PropertisWindow(Event)
 WindowID = EventWindow()
 GadgetID = EventGadget()
   MenuID = EventMenu()
   TypeID = EventType()
 
  Select Event
   Case #PB_Event_Gadget  
      Select GadgetID ; событие на вкладках
        
     EndSelect
  EndSelect
       
EndProcedure   

If MainWindow=0 ; Если запустили отдельно
 PropertisWindow() :HideWindow(#PropertisWindow,0) ; отображаем окно
         
 Repeat :Event = WaitWindowEvent() 
  Event_PropertisWindow(Event) 
   Select Event 
     Case #PB_Event_CloseWindow 
       If EventWindow() = #PropertisWindow 
         End 
       EndIf 
   EndSelect 
  ForEver  
 EndIf

и как убрать рамку у listicongadget

0

33

а здесь почему нету событие на кнопке никак не пойму?

Код:
;================================================================ 
; Program:            ListIcon FillByGadget Sample 
; Author:             netmaestro 
; Date:               January 7, 2007 
; Target OS:          Windows All 
; Target Compiler:    PureBasic 4.02 
; License:            Free, Unrestricted, Credit appreciated 
;                     but not required 
;================================================================ 

#LVM_SUBITEMHITTEST = #LVM_FIRST + 57 
#LVM_GETSUBITEMRECT = #LVM_FIRST + 56 

Global oldproc 
Global currentitem, currentsubitem 

; ------------------------------
;{- SpinGadget_
; ------------------------------
Declare ResizeSpinGadget_(Gadget,left,top,width,heigth)
Declare HideSpinGadget_(Gadget,param)

Procedure SpinGadget_(Gadget,left,top,width,heigth,min,max,pos=0,textpos=2 )
 Global SpinGadget_,SpinGadget_String,SpinGadget_UpDown
  UpDownWidth =17
  SpinGadget_  =ContainerGadget(#PB_Any ,0,0,0,0); ,#PB_Container_Flat
  SpinGadget_String =StringGadget(Gadget,0,0,0,0,"",textpos|#PB_String_Numeric)
  SpinGadget_UpDown =  CreateUpDownControl_(#WS_CHILD|#WS_VISIBLE|#UDS_SETBUDDYINT|#UDS_ARROWKEYS,0,0,0,0,GadgetID(SpinGadget_),1,GetModuleHandle_(0),GadgetID(Gadget),max,min,pos)
  CloseGadgetList()
  ResizeSpinGadget_(Gadget,0,0,100,20)
  If Gadget=#PB_Any
    ProcedureReturn SpinGadget_String
  EndIf  
EndProcedure 

Procedure ResizeSpinGadget_(Gadget,left,top,width,heigth)
  UpDownWidth =17
  ResizeGadget(SpinGadget_ ,left,top,width,heigth)
  ResizeGadget(gadget ,0,0,width-UpDownWidth+1,heigth)
  MoveWindow_(SpinGadget_UpDown,GadgetWidth(gadget),-1,UpDownWidth,heigth+2,1)
     
EndProcedure

Procedure HideSpinGadget_(Gadget,param)
  If param =1
    param=0
  Else
    param=1
  EndIf  
    
  ShowWindow_(GadgetID(SpinGadget_),param)  
  ShowWindow_(GadgetID(Gadget),param)  
  ShowWindow_(SpinGadget_UpDown,param)  
  
EndProcedure
;}------------------------------
; ------------------------------

Procedure MainWindowCallBack(hwnd, msg, wparam, lparam) 
  result = #PB_ProcessPureBasicEvents 

  Select msg 
    Case #WM_SIZE
      RedrawWindow_(WindowID(0), 0, 0, #RDW_UPDATENOW|#RDW_ALLCHILDREN) ; с начало убирает мерцание Окна
      ResizeGadget(10,3,3, WindowWidth(0)-6,WindowHeight(0)-6) 
       
      ResizeGadget(0,-2,-26, GadgetWidth(10)+1,GadgetHeight(10)+1+26) 
      ;SetGadgetItemAttribute(0, 1,#PB_ListIcon_ColumnWidth , GadgetWidth(5)-232,0)
       ;SetGadgetItemAttribute(0, 2,#PB_ListIcon_ColumnWidth , 100,0)
       
      
    Case #WM_DRAWITEM 
      
     Global *lpdis.DRAWITEMSTRUCT = lparam 
     Global  Dim itemrect.RECT(3) 
      For i = 0 To 3 
        RtlZeroMemory_(@itemrect(i),SizeOf(RECT)) 
        itemrect(i)\top = i 
        SendMessage_(*lpdis\hwndItem, #LVM_GETSUBITEMRECT, *lpdis\itemid, @itemrect(i)) 
        text$ = GetGadgetItemText(GetDlgCtrlID_(*lpdis\hwndItem), *lpdis\itemid, i) 
        
        If *lpdis\itemid=1 Or *lpdis\itemid=6 Or *lpdis\itemid=11 Or *lpdis\itemid=26
          hpen = CreatePen_(#PS_SOLID, 1, $D0D0D0); цвет рамки
          WhiteBrush = CreateSolidBrush_($D0D0D0) ; цвет строки
        Else
          hpen = CreatePen_(#PS_SOLID, 1, RGB(114, 151, 203)); цвет рамки
          WhiteBrush = GetStockObject_(#HOLLOW_BRUSH) ; Прозрачная кисть.
          ;WhiteBrush = CreateSolidBrush_($00FFFF) ; цвет строк
        EndIf
        
        SetBkMode_(*lpdis\hDC, #TRANSPARENT) ;убрать белый фон
        SelectObject_(*lpdis\hDC, hpen);
        ;SelectObject_(*lpdis\hDC, GetStockObject_(#NULL_PEN)) ; убрать рамку вокруг строки
        
        SelectObject_(*lpdis\hDC, WhiteBrush) 
        Rectangle_(*lpdis\hDC, itemrect(i)\left+1, itemrect(i)\top+1, itemrect(i)\right, itemrect(i)\bottom) 
        
        TextOut_(*lpdis\hDC, itemrect(i)\left+4, itemrect(i)\top+5, text$, Len(text$)) 

        DeleteObject_(hpen)
        DeleteObject_(WhiteBrush) 
      Next 

    Case #WM_MEASUREITEM 
    
      *lpmis.MEASUREITEMSTRUCT = lparam 
      *lpmis\itemheight = 22
      

  EndSelect 
  
  ProcedureReturn result 
  
EndProcedure 

Procedure Resize(hwnd)
  RtlZeroMemory_(@itemrect.RECT,SizeOf(RECT)) 
  itemrect\top = currentsubitem 
  SendMessage_(hwnd,#LVM_GETSUBITEMRECT, currentitem, @itemrect)       
  ResizeGadget(1,itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1)
  ResizeSpinGadget_(2, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
  InvalidateRect_(GadgetID(1),0,1)
  InvalidateRect_(GadgetID(SpinGadget_),0,1)
EndProcedure

Procedure SubClass_LV(hwnd, msg, wparam, lparam) 
  result = CallWindowProc_(oldproc, hwnd, msg, wparam, lparam) 
  
  If msg = #WM_RBUTTONDOWN Or msg = #WM_LBUTTONDOWN ;Or msg = #WM_CREATE
    GetCursorPos_(@cp.POINT) 
    MapWindowPoints_(0,hwnd,@cp,1) 
    HitInfo.LVHITTESTINFO 
    Hitinfo\pt\x = cp\x 
    HitInfo\pt\y = cp\y 
    SendMessage_(hwnd,#LVM_SUBITEMHITTEST ,0,@HitInfo) 
    If hitinfo\isubitem = 1 And HitInfo\iItem >= 0 ;если шелкнули по 1 стольбцу
       currentitem    = hitinfo\iitem 
       currentsubitem = hitinfo\isubitem+1 
       RtlZeroMemory_(@itemrect.RECT,SizeOf(RECT)) 
       itemrect\top = hitinfo\iSubItem+1 
       SendMessage_(hwnd,#LVM_GETSUBITEMRECT, hitinfo\iitem, @itemrect) 
    
      
     ElseIf hitinfo\isubitem = 2 And HitInfo\iItem >= 0 ;если шелкнули по 2 стольбцу
      currentitem    = hitinfo\iitem 
      currentsubitem = hitinfo\isubitem 
      RtlZeroMemory_(@itemrect.RECT,SizeOf(RECT)) 
      itemrect\top = hitinfo\iSubItem 
      SendMessage_(hwnd,#LVM_GETSUBITEMRECT, hitinfo\iitem, @itemrect) 
      
       ;StringGadget
      If currentitem =0 Or currentitem =12
        ResizeGadget(3, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(3,GetGadgetItemText(0,currentitem,currentsubitem))
        SetFocus_(GadgetID(3))
        HideGadget(3,0) 
        HideSpinGadget_(2,1) 
        HideGadget(1,1) 
        HideGadget(4,1) 
        
        ElseIf currentitem =1
        ;SpinGadget
        ElseIf currentitem =2 Or currentitem =3 Or currentitem =4 Or currentitem =5
        ResizeSpinGadget_(2, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(2,GetGadgetItemText(0,currentitem,currentsubitem))
        SetFocus_(GadgetID(2))
        HideSpinGadget_(2,0) 
        HideGadget(1,1) 
        HideGadget(3,1) 
        HideGadget(4,1) 
        
        ElseIf currentitem =6
        ;ButtonGadget
        ElseIf currentitem =7 Or currentitem =8 Or currentitem =9 Or currentitem =10 Or currentitem =21 Or currentitem =24
        ResizeGadget(8, itemrect\left+77, itemrect\top+2, itemrect\right-itemrect\left-78, itemrect\bottom-itemrect\top-3) 
        SetGadgetText(8,"...")
        SetFocus_(GadgetID(8))
        HideGadget(8,0) 
        HideSpinGadget_(2,1) 
        HideGadget(1,1) 
        HideGadget(3,1) 
        ;откючаем эти строки
        ElseIf currentitem =11
         
        ElseIf currentitem =26
        
        ;Combobox
        ElseIf currentitem =28
        ResizeGadget(5, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(5,GetGadgetItemText(0,currentitem,currentsubitem))
        SetFocus_(GadgetID(5))
        HideGadget(5,0) 
        HideSpinGadget_(2,1) 
        HideGadget(3,1) 
        HideGadget(4,1)  
        HideGadget(6,1)  
        
        ;Combobox
        ElseIf currentitem =29
        ResizeGadget(6, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(6,GetGadgetItemText(0,currentitem,currentsubitem))
        SetFocus_(GadgetID(6))
        HideGadget(6,0) 
        HideSpinGadget_(2,1) 
        HideGadget(3,1) 
        HideGadget(4,1)  
        HideGadget(5,1) 
         
       ;ComboboxGadget 
       Else
        ResizeGadget(1, itemrect\left+1, itemrect\top+1, itemrect\right-itemrect\left-1, itemrect\bottom-itemrect\top-1) 
        SetGadgetText(1,GetGadgetItemText(0,currentitem,currentsubitem))
        SetFocus_(GadgetID(1))
        HideGadget(1,0) 
        HideSpinGadget_(2,1) 
        HideGadget(3,1) 
        HideGadget(4,1) 
        
      EndIf
        
      
        
       Else 
        ;Debug currentsubitem
        HideGadget(1,1) 
        HideSpinGadget_(2,1) 
        HideGadget(3,1) 
        HideGadget(4,1) 
        HideGadget(5,1) 
        HideGadget(6,1) 
        
      EndIf 
     
  ElseIf msg=#WM_HSCROLL Or msg=#WM_VSCROLL 
    Resize(hwnd)
  ElseIf msg=#WM_NOTIFY 
    *nmHEADER.HD_NOTIFY = lParam 
    Select *nmHEADER\hdr\code 
      Case #HDN_ITEMCHANGING
        Resize(hwnd)
    EndSelect 

  EndIf 
  
  ProcedureReturn result 
  
EndProcedure 

OpenWindow(0,0,0,259,760,"",$CF0001) 
ContainerGadget(10, 0,0,0,0, #PB_Container_Flat)
  
ListIconGadget(0,0,0,0,0,"",0,#LVS_OWNERDRAWFIXED) 
;SetGadgetItemColor(0,  5, #PB_Gadget_BackColor,  $00FFFF, -1)
oldproc = SetWindowLongPtr_(GadgetID(0), #GWL_WNDPROC, @SubClass_LV()) 
AddGadgetColumn(0,1,"Название",130) 
AddGadgetColumn(0,2,"Значение",100) 
SetGadgetColor(0,#PB_Gadget_BackColor, RGB(239, 239, 239)) ; установить цветь фона
    

AddGadgetItem(0, -1, Chr(10) + "Name" + Chr(10) + "Window" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "РАЗМЕРЫ ОКНА" + Chr(10) + "" + Chr(10) ) 

AddGadgetItem(0, -1, Chr(10) + "Left" + Chr(10) + "5" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "Top" + Chr(10) + "5" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "Width" + Chr(10) + "350" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "Height" + Chr(10) + "200" + Chr(10)  )

AddGadgetItem(0, -1, Chr(10) + "ВИД ОКНА  " + Chr(10) + "" + Chr(10)  ) 

AddGadgetItem(0, -1, Chr(10) + "BackColor" + Chr(10) + "" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "BackgraundImage" + Chr(10) + "" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "Cursor" + Chr(10) + "Default" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "Font" + Chr(10) + "" + Chr(10)  ) 

AddGadgetItem(0, -1, Chr(10) + "СТИЛЬ ОКНА  " + Chr(10) + "" + Chr(10)  ) 

AddGadgetItem(0, -1, Chr(10) + "Caption" + Chr(10) + "Window" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "Visible" + Chr(10) + "True" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "Enable" + Chr(10) + "True" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "ControlBox" + Chr(10) + "True" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "CloseBox" + Chr(10) + "True" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "MaximizeBox" + Chr(10) + "True" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "MinimizeBox" + Chr(10) + "True" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "HelpBox" + Chr(10) + "False" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "SizeBox" + Chr(10) + "True" + Chr(10)   ) 
AddGadgetItem(0, -1, Chr(10) + "Icon" + Chr(10) + "" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "ShowIcon" + Chr(10) + "True" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "ShowInTaskbar" + Chr(10) + "True" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "Opacity" + Chr(10) + "100%" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "RighttoLeft" + Chr(10) + "False" + Chr(10)  ) 

AddGadgetItem(0, -1, Chr(10) + "ПОВЕДЕНИЕ ОКНА  " + Chr(10) + "" + Chr(10)  ) 

AddGadgetItem(0, -1, Chr(10) + "TopMost" + Chr(10) + "False" + Chr(10) ) 
AddGadgetItem(0, -1, Chr(10) + "StartPosition" + Chr(10) + "CenterScreen" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "WindowState" + Chr(10) + "Normal" + Chr(10)  ) 
AddGadgetItem(0, -1, Chr(10) + "AllowDrop" + Chr(10) + "False" + Chr(10)   ) 
AddGadgetItem(0, -1, Chr(10) + "AutoScroll" + Chr(10) + "False" + Chr(10) ) 



ComboBoxGadget(1, 0,0,0,0,#PB_ComboBox_Editable) 
SetParent_(GadgetID(1),GadgetID(0)) 
AddGadgetItem(1,0,"True") 
AddGadgetItem(1,1,"False") 


SpinGadget_(2,5, 183, 100, 20, 0, 2000,13,0)
SetParent_(GadgetID(SpinGadget_),GadgetID(0)) 


StringGadget(3,5, 183, 100, 20, "")
SetParent_(GadgetID(3),GadgetID(0)) 

ButtonImageGadget(8,5, 183, 100, 20,0)
SetParent_(GadgetID(8),GadgetID(0)) 

ComboBoxGadget(6, 0,0,0,0,#PB_ComboBox_Editable) 
SetParent_(GadgetID(6),GadgetID(0)) 
AddGadgetItem(6,0,"Normal") 
AddGadgetItem(6,0,"Minimized") 
AddGadgetItem(6,1,"Maximized") 

ComboBoxGadget(5, 0,0,0,0,#PB_ComboBox_Editable) 
SetParent_(GadgetID(5),GadgetID(0)) 
AddGadgetItem(5,0,"CenterScreen") 
AddGadgetItem(5,1,"CenterParent") 



HideGadget(1,1) 
HideSpinGadget_(2,1)
HideGadget(3,1) 
HideGadget(8,1) 
HideGadget(5,1) 
HideGadget(6,1) 

CloseGadgetList()

      
SetWindowCallback(@MainWindowCallBack()) 

;SetGadgetItemAttribute(0, 1,#PB_ListIcon_ColumnWidth , GadgetWidth(0)-232,-1)
ResizeGadget(0,-2,-26, GadgetWidth(10)+1,GadgetHeight(10)+1+26) 
ResizeGadget(10,3,3, WindowWidth(0)-6,WindowHeight(0)-6) 

Repeat 
EventID = WaitWindowEvent() 
  Select EventID 
    Case #PB_Event_Gadget 
      ;Debug EventGadget()
      If currentitem <>1 And currentitem <>6 And currentitem <>11 And currentitem <>26 And currentsubitem>1
        Select EventGadget() 
          Case 1 
            SetGadgetItemText(0, currentitem, GetGadgetText(1), currentsubitem) 
          Case 2 
            SetGadgetItemText(0, currentitem, GetGadgetText(2), currentsubitem) 
          Case 3 
            SetGadgetItemText(0, currentitem, GetGadgetText(3), currentsubitem) 
          Case 4 
            Debug currentitem;SetGadgetItemText(0, currentitem, GetGadgetText(4), currentsubitem) 
            If  currentitem=7
              
            EndIf  
          Case 5 
            SetGadgetItemText(0, currentitem, GetGadgetText(5), currentsubitem) 
          Case 6
            SetGadgetItemText(0, currentitem, GetGadgetText(6), currentsubitem) 
           
        EndSelect 
      EndIf

   
  EndSelect 
Until EventID = #WM_CLOSE

0

34

Тогда нужно где-то хранить цвет каждой строки (например в SetGadgetItemData())

без примера пока сложно для меня, потом вернусь к нему.

0

35

mestnyi написал(а):

и как убрать рамку у listicongadget

Стандартных методов нет.
Можно изменить стиль контрола (используя SetwindowLongPtr_()).

Код:
OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
hWnd=ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")

SetWindowLongPtr_(hWnd, #GWL_EXSTYLE, GetWindowLongPtr_(hWnd, #GWL_EXSTYLE)&~#WS_EX_CLIENTEDGE)
Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
mestnyi написал(а):

а здесь почему нету событие на кнопке никак не пойму?

У меня встречный вопрос. Почему прога так написана что падает? Зачем скрывать несуществующие гаджеты?

0

36

У меня встречный вопрос. Почему прога так написана что падает? Зачем скрывать несуществующие гаджеты?

раньше под номером 4 был а теперь переделал на 8 вот почему.

раньше работало в 5.11

Код:
CreateImage(1,32,32,32|#PB_Image_Transparent )

а теперь в справке вот так

Код:
 CreateImage(1,32,32,32,#PB_Image_Transparent )

но не работает, что делать?

Вот у меня разные вопросы, мне для них новые темы создавать, или можно здесь писать?

0

37

mestnyi написал(а):

а теперь в справке вот так

Версия PB?

0

38

5.20

0

39

Все работает.

Код:
If OpenWindow(0, 0, 0, 200, 200, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If CreateImage(0, 200, 200, 32, #PB_Image_Transparent) And
     StartDrawing(ImageOutput(0))
    DrawingMode(#PB_2DDrawing_Outlined|#PB_2DDrawing_AllChannels)
    y = 0
    For x = 0 To 95 Step 10
      Box(x, y, 200-2*x, 200-2*y, RGBA(Random(255), Random(255), Random(255), Random(255)))
      y + 10        ; the same as y = y + 10
    Next x
    StopDrawing() 
    ImageGadget(0, 0, 0, 200, 200, ImageID(0))
  EndIf
  
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

0