Page 1 of 1

[Module] ModuleEx - Mastermodul for custom gadgets

Posted: Tue Apr 02, 2019 2:58 pm
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

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Posted: Thu Nov 14, 2019 9:40 am
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

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Posted: Tue Nov 19, 2019 11:04 am
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"?

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Posted: Tue Nov 19, 2019 4:40 pm
by Thorsten1867
Fixed

Re: [Module] ModuleEx - Mastermodul for custom gadgets

Posted: Fri Apr 10, 2020 5:53 pm
by Cyllceaux
next :)

Code: Select all

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