It is currently Sun Sep 22, 2019 7:30 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [Module] ModuleEx - Mastermodul for custom gadgets
PostPosted: Tue Apr 02, 2019 2:58 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 897
Location: Germany
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).

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:
; ModuleEx::AddGadget()                - add a gadget for tabulator handling  (#UseTabulator|#IgnoreTabulator)
; ModuleEx::AddWindow()                - enables the tabulator handling and cursor event for this window  (#Tabulator|#CursorEvent)
; ModuleEx::CursorFrequency()          - changes the cursor frequency (default: 600ms)
; ModuleEx::ExitCursorThread()         - exit cursor thread


Example for use within own modules:
Code:
; 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

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye