Module für PureBasic 5.6x

Hier könnt Ihr gute, von Euch geschriebene Codes posten. Sie müssen auf jeden Fall funktionieren und sollten möglichst effizient, elegant und beispielhaft oder einfach nur cool sein.
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: Module für PureBasic 5.6x

Beitrag von Thorsten1867 »

ScaleGadget.pbi
PB V5.6x
(All OS)

Scaling of all Windows and Gadgets

Code: Alles auswählen

  SetScaleGadget(x.f = 1.0, y.f = 1.0, dx.f = 1.0, dy.f = 1.0, Font.f = 0.0)
  SetScaleWindow(x.f = 1.0, y.f = 1.0, dx.f = 1.0, dy.f = 1.0)
  SetScaleFontID(Gadget, FontID)
  SetScaleFontCallback(Gadget, *Callback)

  SetScaleImage(Gadget, ImageID)
  SetScaleMode(Mode)                      ; Set mode for result of position and size from windows and gadgets
  SetScaleModeImage(Mode)                 ; Set mode update of images size
  SetScaleModeFont(Mode)                  ; Set mode update of font size

  GetDynamicScaleX(Window)                ; Returns the current dynamic scaling of ScaleAllGadgets
  GetDynamicScaleY(Window)                ; Returns the current dynamic scaling of ScaleAllGadgets

  ScaleResizeGadget(Gadget, x, y, dx, dy) ; Resize gadget with scaling and dynamic scaling
  ScaleResizeWindow(Window, x, y, dx, dy) ; Resize window
  ScaleAllGadgets(Window, DeltaDY = 0)    ; Scales dynamic all gadgets from the window

  ScaleOpenGadgetList(Gadget, GadgetItem = 0)
  ScaleCloseGadgetList()
  ScaleSetGadgetAttribute(Gadget, Attribute, Value)

  ScaleWindowWidth(Window, Mode = #PB_Window_InnerCoordinate)
  ScaleWindowHeight(Window, Mode = #PB_Window_InnerCoordinate)
  ScaleWindowBounds(Window, MinimumWidth, MinimumHeight, MaximumWidth, MaximumHeight)
  ScaleGadgetX(Gadget, Mode = 0)
  ScaleGadgetY(Gadget, Mode = 0)
  ScaleGadgetWidth(Gadget, Mode = 0)
  ScaleGadgetHeight(Gadget, Mode = 0)

  ScaleCloseWindow(Window)
  ScaleFreeGadget(Gadget)

  ScaleRegisterGadget(Gadget, *Callback = 0, Name.s = "") ; Register your owner draw gadget
  ScaleUnregisterGadget(Gadget)                           ; Unregister your owner draw gadget

  ScaleUpdateGadget(Gadget)

  CreateWindow(Name.s, Window, x, y, InnerWidth, InnerHeight, Title.s, Flags, ParentID)
  CreateGadget(Type, Name.s, Gadget, x, y, dx, dy, Text.s, Param1, Param2, Param3, Flags)

  ParentWindow(Gadget)
  ParentGadget(Gadget)
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: Module für PureBasic 5.6x

Beitrag von Thorsten1867 »

ListExModule.pbi
PB V5.7x
(All OS)

Editierbares & sortierbares List - Gadget

Code: Alles auswählen

; ListEx::AddItem()             - similar to 'AddGadgetItem()'
; ListEx::AddColumn()           - similar to 'AddGadgetColumn()'
; ListEx::AddComboBoxItems()    - add items to the comboboxes of the column (items seperated by #LF$)
; ListEx::ClearComboBoxItems()  - clear items of the comboboxes of the column
; ListEx::ClearItems()          - similar to 'ClearGadgetItems()'
; ListEx::DisableEditing()      - disable editing for the complete list
; ListEx::EventColumn()         - column of event (Event: ListEx::#Event_Module)
; ListEx::EventRow()            - row of event    (Event: ListEx::#Event_Module)
; ListEx::EventState()          - returns state   (e.g. CheckBox / DateGadget)
; ListEx::EventValue()          - returns value   (string)
; ListEx::EventID()             - returns row ID or header label 
; ListEx::Gadget()              - [#GridLines|#NumberedColumn|#NoRowHeader]
; ListEx::GetAttribute()        - similar to 'GetGadgetAttribute()'
; ListEx::GetCellText()         - similar to 'GetGadgetItemText()' with labels
; ListEx::GetCellState()        - similar to 'GetGadgetItemState()' with labels
; ListEx::GetChangedState()     - check whether entries have been edited
; ListEx::GetColumnAttribute()  - similar to 'GetGadgetItemAttribute()'
; ListEx::GetColumnState()      - similar to 'GetGadgetItemState()' for a specific column
; ListEx::GetItemData()         - similar to 'GetGadgetItemData()'
; ListEx::GetItemID()           - similar to 'GetGadgetItemData()' but with string data
; ListEx::GetItemState()        - similar to 'GetGadgetItemState()'
; ListEx::GetItemText()         - similar to 'GetGadgetItemText()'
; ListEx::Refresh()             - redraw gadget
; ListEx::RemoveColumn()        - similar to 'RemoveGadgetColumn()'
; ListEx::RemoveItem()          - similar to 'RemoveGadgetItem()'
; ListEx::ResetChangedState()   - reset to not edited
; ListEx::SetAutoResizeColumn() - column that is reduced when the vertical scrollbar is displayed.
; ListEx::SetCellState()        - similar to 'SetGadgetItemState()' with labels
; ListEx::SetCellText()         - similar to 'SetGadgetItemText()' with labels
; ListEx::SetColor()            - similar to 'SetGadgetColor()'
; ListEx::SetColumnAttribute()  - [#Align/#Width/#Font]
; ListEx::SetColumnFlag()       - [#Strings/#CheckBoxes/#ComboBoxes/#Buttons]
; ListEx::SetColumnState()      - similar to 'SetGadgetItemState()' for a specific column
; ListEx::SetDateMask()         - similar to 'SetGadgetText()' and 'DateGadget()'
; ListEx::SetDateAttribute()    - similar to 'SetGadgetAttribute()' and 'DateGadget()'
; ListEx::SetFont()             - similar to 'SetGadgetFont()'
; ListEx::SetHeaderAttribute()  - [#Align]
; ListEx::SetHeaderSort()       - enable sort by header column [#Sort_Ascending|#Sort_Descending|#Sort_NoCase|#Sort_SwitchDirection]
; ListEx::SetItemAttribute()    - similar to 'SetGadgetItemAttribute()'
; ListEx::SetItemColor()        - similar to 'SetGadgetItemColor()'
; ListEx::SetItemData()         - similar to 'SetGadgetItemData()'
; ListEx::SetItemFont()         - change font of row or header [#Header]
; ListEx::SetItemID()           - similar to 'SetGadgetItemData()' but with string data
; ListEx::SetItemImage( )       - add a image at row/column
; ListEx::SetItemState()        - similar to 'SetGadgetItemState()'
; ListEx::SetItemText()         - similar to 'SetGadgetItemText()'
; ListEx::SetRowsHeight()       - change height of rows
; ListEx::SetTimeMask()         - change mask for time (sorting)
; ListEx::Sort()                - sort rows by column [#SortString|#SortNumber|#SortFloat|#SortDate|#SortTime|#SortCash / #Deutsch]
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Antworten