[Module] ModuleEx - Mastermodul for custom gadgets

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Module] ModuleEx - Mastermodul for custom gadgets

Post by Thorsten1867 »

ModuleEx - Mastermodul (all OS / 64Bit / DPI)

Management of the tab key (shortcut) within a window (#Tabulator)
  • Switches from one gadget to the next via tabulator or skips this gadget (#IgnoreTabulator).
  • Temporarily releases the tab key when the gadget gets the focus (#UseTabulator).
GUI color themes
  • change the color theme of all supported gadgets with one command
Support of dynamic font
  • font management with support for dynamic character sets
Global cursor event (thread) for all gadgets that need a blinking cursor (#CursorEvent)
  • BindEvent(ModulEx::#Event_Cursor, @_CursorDrawing(), WindowNum)
  • Cursor thread is automatically terminated when the last window is closed.
Uniform EventType constants for PostEvent() to avoid conflicts with different modules.
  • PostEvent(#PB_Event_Gadget, WindowNum, GadgetNum, ModulEx::#EventType_Button)

Code: Select all

; ModuleEx::AddGadget()                - add a gadget for tabulator handling  (#UseTabulator|#IgnoreTabulator)
; ModuleEx::AddWindow()                - enables the tabulator handling for this window  (#Tabulator|#CursorEvent)
; ModuleEx::CursorFrequency()          - changes the cursor frequency (default: 600ms)
; ModuleEx::ExitCursorThread()         - exit cursor thread
; ModuleEx::Font()                     - similar to 'LoadFont()' (supports dynamic fonts)
; ModuleEx::FreeFonts()                - free dynamic font data
; ModuleEx::GetGadgetWindow()          - returns the number of the window in which the gadget is located
; ModuleEx::LoadTheme()                - load a theme for all supportet gadgets
; ModuleEx::RequiredFontSize()         - calculates the required font size
; ModuleEx::SetAttribute()             - [#Padding/#PaddingX/#PaddingY]
; ModuleEx::SetFont()                  - similar to 'SetGadgetFont()' (supports dynamic fonts)
; ModuleEx::SaveTheme()                - save current theme
; ModuleEx::SetColor()                 - change the theme color of all supported gadgets
; ModuleEx::SetTheme()                 - set a theme for all supportet gadgets
Example for use within own modules:

Code: Select all

; Cursor event and EventTypes for PostEvent()

CompilerIf Defined(ModuleEx, #PB_Module)
    
    #Event_Cursor       = ModuleEx::#Event_Cursor
    #EventType_Button   = ModuleEx::#EventType_Button
    
CompilerElse
  
  Enumeration #PB_Event_FirstCustomValue
    ; .....
  EndEnumeration
  
  Enumeration #PB_EventType_FirstCustomValue
    ; .....
  EndEnumeration
  
CompilerEndIf
  
; Add Window and gadgets

CompilerIf Defined(ModuleEx, #PB_Module)

  If ModuleEx::AddWindow(Window, ModuleEx::#Tabulator|ModuleEx::#CursorEvent)
    ModuleEx::AddGadget(Gadget, Window, ModuleEx::#UseTabulator)
  EndIf
  
CompilerElse  
  
 ; .....
  
CompilerEndIf
Download: ModuleEx.pbi
Last edited by Thorsten1867 on Sat Nov 23, 2019 12:38 pm, edited 2 times in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Post by Thorsten1867 »

Update: GUI theme support for all supported gadgets :
  • ButtonEx
  • Calendar
  • CanvasTooltip
  • Chart
  • EditorEx
  • GradualProgress
  • ImageEx
  • ListEx
  • PreView
  • ProgressBarEx
  • StatusBarEx
  • StringEx
  • TextEx
  • ToolBarEx
  • ToolTipEx
  • ViewerEx

Code: Select all

; ModuleEx::LoadTheme()                - load a theme for all supportet gadgets
; ModuleEx::SaveTheme()                - save current theme
; ModuleEx::SetColor()                 - change the theme color of all supported gadgets
; ModuleEx::SetTheme()                 - set a internal theme for all supportet gadgets
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 464
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Post by Cyllceaux »

changing theme while running doesn't redraw gadgets correctly.
ButtonEx, for example, loses text and color.

Mostly by changing from/to darkmode

btw... is there a chance to disable the "saveXML"?
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Post by Thorsten1867 »

Fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 464
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Post by Cyllceaux »

next :)

Code: Select all

[18:51:18] [COMPILER] Zeile 1313: Die Modul-Prozedur 'BlendColor_()' wurde deklariert, aber nicht definiert.
Post Reply