Page 1 sur 1

Module PB_FORM

Publié : lun. 18/janv./2021 13:23
par microdevweb
Voila fini le temps libre, le projet est mit en stantby.

Historique des versions:
Le projet sur github

https://github.com/microdevweb/PB_FORM

Image
Code example of version BETA 1.14 EX18.pb

Code : Tout sélectionner

;*********************************************************************************************************************************************
; AUTHOR   : microdevWeb
; MODULE   : PB_FORM
; VERSION  : BETA 1.14
; LICENCE  : MIT
; EXAMPLE  : option gadget
;*********************************************************************************************************************************************
XIncludeFile "../PB_FORM/Include/PB_FORM.pbi"

Enumeration 
  #BT_FONT
  #STR_FONT
EndEnumeration

Global mainForm.FORM::Form 



LoadFont(#BT_FONT,"arial",12,#PB_Font_Bold)
LoadFont(#STR_FONT,"arial",11)

Procedure evButton(*button.FORM::Button_gadget)
  Debug "You're clicked on the button "+*button\getTitle()
  If *button\getTitle() = "Exit"
    mainForm\close()
    End
  EndIf
EndProcedure

Procedure evChangeDate(*dt.FORM::Date_gadget)
  Debug FormatDate("%yyyy-%mm-%dd",*dt\getValue())
EndProcedure

Procedure evChangeTrackBar(*tb.FORM::TrackBar_gadget)
  Debug *tb\getValue()
EndProcedure

Procedure evCheckboxChange(*c.FORM::CheckBox_gadget)
  Select *c\getState()
    Case #PB_Checkbox_Checked
      Debug "CheckBox is checked"
    Case #PB_Checkbox_Inbetween
      Debug "CheckBox is checked between"
    Case #PB_Checkbox_Unchecked
      Debug "CheckBox is unchecked"
  EndSelect
EndProcedure

Procedure evOption(*o.FORM::Option_gadget)
  If *o\getState()
    Debug "This option "+*o\getTitle()+" is checked"
  Else
    Debug "This option "+*o\getTitle()+" is unchecked"
  EndIf
EndProcedure

Procedure openMainForm()
  UseModule FORM
  ; open window
  mainForm = newForm(0,0,800,0,"Example 18 ")
  ; for close application
  mainForm\setMainForm(#True)
  mainForm\setFlags(#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_SystemMenu)
  ; set min value for main windows
  Define sizes.sizes = mainForm\getSize() : sizes\setMinHeight(300) : sizes\setMinWidth(400)
  ; use HLayout as main layout
  mainLayout.HLayout = mainForm\setMainLayout(newHLayout())
  ; we will expand the left layout
  mainLayout\setExpand(1)
  ;{----------------------------- we create the left layout into the main layout --------------------------------
  Define leftLayout.VLayout = mainLayout\addContent(newVLayout())
  ;leftLayout\setExpand(#LAYOUT_EXPAND_YES)
  Define myDate.Date_gadget = leftLayout\addContent(newDateGadget("%dd-%mm-%yyyy",Date()))
  myDate\setListener(newListener(@evChangeDate()))
  leftLayout\addContent(newTextGadget("Track bar"))
  Define trb.TrackBar_gadget = leftLayout\addContent(newTrackBarGadget(0,100,10))
  trb\setSizes(0,30)
  trb\setListener(newListener(@evChangeTrackBar()))
  Define tbflags.TrackBarFlags = trb\getFlags()
  tbflags\setTicks(#True)
  Define check.CheckBox_gadget = leftLayout\addContent(newCheckBoxGadget("Check Box",#PB_Checkbox_Inbetween))
  Define f.CheckBoxFlags = check\getFlags()
  f\setThreeState(#True)
  check\setListener(newListener(@evCheckboxChange()))
  Define option.Option_gadget = leftLayout\addContent(newOptionGadget("Option 1",1))
  option\setListener(newListener(@evOption()))
  Define option.Option_gadget = leftLayout\addContent(newOptionGadget("Option 2",1,#True))
  option\setListener(newListener(@evOption()))
  Define e.Empty = leftLayout\addContent(newEmpty())
  e\setSizes(0,10)
  Define option.Option_gadget = leftLayout\addContent(newOptionGadget("Option 3",2))
  option\setListener(newListener(@evOption()))
  Define option.Option_gadget = leftLayout\addContent(newOptionGadget("Option 4",2))
  option\setListener(newListener(@evOption()))
  Define option.Option_gadget = leftLayout\addContent(newOptionGadget("Option 5",2))
  option\setListener(newListener(@evOption()))
  ;} ------------------------------------------------------------------------------------------------------------
  ;{------------------------------ we create the right layout ---------------------------------------------------
  Define rightLayout.VLayout = mainLayout\addContent(newVLayout())
  rightLayout\setFont(#BT_FONT)
  ; we add button into the right layout
  Define bt.Button_gadget = rightLayout\addContent(newButtonGadget("New",newListener(@evButton())))
  bt\setSizes(100,0)
  bt\setShortcut(newShortCut(#PB_Shortcut_Control|#PB_Shortcut_N,"New CTRL + N"))
  Define bt.Button_gadget = rightLayout\addContent(newButtonGadget("Edit",newListener(@evButton())))
  bt\setShortcut(newShortCut(#PB_Shortcut_Control|#PB_Shortcut_E,"Edit CTRL + E"))
  Define bt.Button_gadget = rightLayout\addContent(newButtonGadget("Delete",newListener(@evButton())))
  bt\setShortcut(newShortCut(#PB_Shortcut_Control|#PB_Shortcut_Delete,"Delete CTRL + Delete"))
  
  Define e.Empty = rightLayout\addContent(newEmpty())
  Define s.Sizes = e\getSizes() : s\setHeight(40)
  Define bt.Button_gadget = rightLayout\addContent(newButtonGadget("Exit",newListener(@evButton())))
  bt\setShortcut(newShortCut(#PB_Shortcut_Control|#PB_Shortcut_Q,"Exit CTRL + Q"))
  ;} ------------------------------------------------------------------------------------------------------------
  ; open window
  mainForm\open()
EndProcedure

openMainForm()

Repeat 
  WaitWindowEvent()
ForEver
Image
Code example of version BETA 1.10 EX14.pb

Code : Tout sélectionner

;*********************************************************************************************************************************************
; AUTHOR   : microdevWeb
; MODULE   : PB_FORM
; VERSION  : BETA 1.10
; LICENCE  : MIT
; EXAMPLE  : gadgetFont
;*********************************************************************************************************************************************
XIncludeFile "../PB_FORM/Include/PB_FORM.pbi"

Enumeration 
  #BT_FONT
  #STR_FONT
EndEnumeration

Global mainForm.PB_FORM::Form 
Global.PB_FORM::GadgetString field1,field3,field4
Global.PB_FORM::GadgetSpin field2

LoadFont(#BT_FONT,"arial",12,#PB_Font_Bold)
LoadFont(#STR_FONT,"arial",11)

Procedure evButton(*button.PB_FORM::GadgetButton)
  Debug "You're clicked on the button "+*button\getTitle()
EndProcedure

Procedure evChange(*string.PB_FORM::GadgetString)
  Debug *string\getValue()
EndProcedure

Procedure spinChange(*spin.PB_FORM::GadgetSpin)
  With *spin
    SetGadgetText(*spin\getId(),Str(*spin\getValue()) + "%")
  EndWith
EndProcedure

Procedure openMainForm()
  UseModule PB_FORM
  ; open window
  mainForm = newForm(0,0,800,0,"Example 14 gadget spin ")
  ; for close application
  mainForm\setMainForm(#True)
  mainForm\setFlags(#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
  ; set min value for main windows
  Define sizes.sizes = mainForm\getSize() : sizes\setMinHeight(300) : sizes\setMinWidth(400)
  ; use HLayout as main layout
  mainLayout.HLayout = mainForm\setMainLayout(newHLayout())
  ; we will expand the left layout
  mainLayout\setExpand(1)
  ; we create the left layout into the main layout
  Define leftLayout.VLayout = mainLayout\addContent(newVLayout())
  leftLayout\setFont(#STR_FONT)
  leftLayout\setExpand(#LAYOUT_EXPAND_YES)
  leftLayout\setSpace(15)
  ; we add string gadget
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 1"))
  lb\setFrontColor($0000EE)
  field1 = leftLayout\addContent(newGadgetString("i'm the field 1"))
  field1\setBackgroundColor($0066CD)

  
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 2"))
  field2 = leftLayout\addContent(newGadgetSpin(0,100))
  field2\setListener(newListener(@spinChange()))
  
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 3"))
  field3 = leftLayout\addContent(newGadgetString())
  
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 4"))
  field4 = leftLayout\addContent(newGadgetString())
  
  ; we create the right layout
  Define rightLayout.VLayout = mainLayout\addContent(newVLayout())
  rightLayout\setFont(#BT_FONT)
  ; we add button into the right layout
  Define bt.GadgetButton = rightLayout\addContent(newGadgetButton("New",newListener(@evButton())))
  bt\setSizes(100,0)
  rightLayout\addContent(newGadgetButton("Edit",newListener(@evButton())))
  rightLayout\addContent(newGadgetButton("Delete",newListener(@evButton())))
  Define e.Empty = rightLayout\addContent(newEmpty())
  Define s.Sizes = e\getSizes() : s\setHeight(40)
  rightLayout\addContent(newGadgetButton("Exit",newListener(@evButton())))
  
  ; open window
  mainForm\open()
EndProcedure

openMainForm()

Repeat 
  WaitWindowEvent()
ForEver
Image
Code example of version BETA 1.9 EX12.pb

Code : Tout sélectionner

;*********************************************************************************************************************************************
; AUTHOR   : microdevWeb
; MODULE   : PB_FORM
; VERSION  : BETA 1.8
; LICENCE  : MIT
; EXAMPLE  : gadgetFont
;*********************************************************************************************************************************************
XIncludeFile "../PB_FORM/Include/PB_FORM.pbi"

Enumeration 
  #BT_FONT
  #STR_FONT
EndEnumeration

Global mainForm.PB_FORM::Form 
Global.PB_FORM::GadgetString field1,field2,field3,field4

LoadFont(#BT_FONT,"arial",12,#PB_Font_Bold)
LoadFont(#STR_FONT,"arial",16,#PB_Font_Bold)

Procedure evButton(*button.PB_FORM::GadgetButton)
  Debug "You're clicked on the button "+*button\getTitle()
EndProcedure

Procedure evChange(*string.PB_FORM::GadgetString)
  Debug *string\getValue()
EndProcedure

Procedure openMainForm()
  UseModule PB_FORM
  ; open window
  mainForm = newForm(0,0,800,0,"Example 12 gadget text and set gadget font ")
  ; for close application
  mainForm\setMainForm(#True)
  mainForm\setFlags(#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
  ; set min value for main windows
  Define sizes.sizes = mainForm\getSize() : sizes\setMinHeight(300) : sizes\setMinWidth(400)
  ; use HLayout as main layout
  mainLayout.HLayout = mainForm\setMainLayout(newHLayout())
  ; we will expand the left layout
  mainLayout\setExpand(1)
  ; we create the left layout into the main layout
  Define leftLayout.VLayout = mainLayout\addContent(newVLayout())
  leftLayout\setExpand(#LAYOUT_EXPAND_YES)
  leftLayout\setSpace(15)
  ; we add string gadget
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 1"))
  lb\setFont(#STR_FONT)
  field1 = leftLayout\addContent(newGadgetString())
  field1\setFont(#STR_FONT)
  
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 2"))
  field2 = leftLayout\addContent(newGadgetString())
  
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 3"))
  field3 = leftLayout\addContent(newGadgetString())
  
  Define   lb.GadgetText = leftLayout\addContent(newGadgetText("Field 4"))
  field4 = leftLayout\addContent(newGadgetString())
  
  ; we create the right layout
  Define rightLayout.VLayout = mainLayout\addContent(newVLayout())
  rightLayout\setFont(#BT_FONT)
  ; we add button into the right layout
  Define bt.GadgetButton = rightLayout\addContent(newGadgetButton("New",newListener(@evButton())))
  bt\setSizes(100,0)
  rightLayout\addContent(newGadgetButton("Edit",newListener(@evButton())))
  rightLayout\addContent(newGadgetButton("Delete",newListener(@evButton())))
  Define e.Empty = rightLayout\addContent(newEmpty())
  Define s.Sizes = e\getSizes() : s\setHeight(40)
  rightLayout\addContent(newGadgetButton("Exit",newListener(@evButton())))
  
  ; open window
  mainForm\open()
EndProcedure

openMainForm()

Repeat 
  WaitWindowEvent()
ForEver
Image
Code exemple version BETA 1.7 EX11.pb (custom gadget)

Code : Tout sélectionner

;*********************************************************************************************************************************************
; AUTHOR   : microdevWeb
; MODULE   : PB_FORM
; VERSION  : BETA 1.7
; LICENCE  : MIT
; EXAMPLE  : add custom gadget
;*********************************************************************************************************************************************
XIncludeFile "../PB_FORM/Include/PB_FORM.pbi"
Global mainForm.PB_FORM::Form 
Global.PB_FORM::GadgetCustom cus1,cus2,cus3

LoadFont(0,"arial",12,#PB_Font_HighQuality|#PB_Font_Bold)

Procedure evButton(*button.PB_FORM::GadgetButton)
  Debug "You're clicked on the button "+*button\getTitle()
EndProcedure

Procedure evCustom(*cus.PB_FORM::GadgetCustom)
  Select EventType()
    Case #PB_EventType_MouseMove
      Debug GetGadgetAttribute(*cus\getId(),#PB_Canvas_MouseX)
  EndSelect
EndProcedure

Procedure buildCustom(*cus.PB_FORM::GadgetCustom)
  StartVectorDrawing(CanvasVectorOutput(*cus\getId()))
  VectorFont(FontID(0))
  Protected w = GadgetWidth(*cus\getId()),
            h = GadgetHeight(*cus\getId()),
            text.s,wt,ht,xc,yc
  AddPathBox(0,0,w,h)
  Select *cus
    Case cus1
      VectorSourceColor($FF08C208)
      text = "Field 1"
    Case cus2
      VectorSourceColor($FF0000FF)
      text = "Field 2"
    Case cus3
      VectorSourceColor($FFCD00CD)
      text = "Field 3"
  EndSelect
  FillPath()
  wt = VectorTextWidth(text)
  ht = VectorTextHeight(text)
  xc = (w / 2) - (wt / 2)
  yt = (h / 2) - (ht / 2)
  MovePathCursor(xc,yt)
  VectorSourceColor($FF000000)
  DrawVectorText(text)
  StopVectorDrawing()
EndProcedure





Procedure openMainForm()
  UseModule PB_FORM
  ; open window
  mainForm = newForm(0,0,800,0,"Example 11 custom gadget ")
  ; for close application
  mainForm\setMainForm(#True)
  mainForm\setFlags(#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
  ; set min value for main windows
  Define sizes.sizes = mainForm\getSize() : sizes\setMinHeight(300) : sizes\setMinWidth(400)
  ; use HLayout as main layout
  mainLayout.HLayout = mainForm\setMainLayout(newHLayout())
  ; we will expand the left layout
  mainLayout\setExpand(1)
  ; we create the left layout into the main layout
  Define leftLayout.VLayout = mainLayout\addContent(newVLayout())
  leftLayout\setExpand(#LAYOUT_EXPAND_YES)
  leftLayout\setSpace(15)
  ; we add custom gadget
  cus1 = leftLayout\addContent(newGadgetCustom(@buildCustom(),@evCustom()))
  cus2 = leftLayout\addContent(newGadgetCustom(@buildCustom(),@evCustom()))
  cus3 = leftLayout\addContent(newGadgetCustom(@buildCustom(),@evCustom()))
  ; we create the right layout
  Define rightLayout.VLayout = mainLayout\addContent(newVLayout())
  ; we add button into the right layout
  Define bt.GadgetButton = rightLayout\addContent(newGadgetButton("New",newListener(@evButton())))
  bt\setSizes(100,0)
  rightLayout\addContent(newGadgetButton("Edit",newListener(@evButton())))
  rightLayout\addContent(newGadgetButton("Delete",newListener(@evButton())))
  Define e.Empty = rightLayout\addContent(newEmpty())
  Define s.Sizes = e\getSizes() : s\setHeight(40)
  rightLayout\addContent(newGadgetButton("Exit",newListener(@evButton())))
  
  ; open window
  mainForm\open()
EndProcedure

openMainForm()

Repeat 
  WaitWindowEvent()
ForEver

Image

Code exemple version BETA 1.6 EX10.pb

Code : Tout sélectionner

;*********************************************************************************************************************************************
; AUTHOR   : microdevWeb
; MODULE   : PB_FORM
; VERSION  : BETA 1.6
; LICENCE  : MIT
; EXAMPLE  : add gadget frame
;*********************************************************************************************************************************************
XIncludeFile "../PB_FORM/Include/PB_FORM.pbi"
Global mainForm.PB_FORM::Form 
Global.PB_FORM::GadgetString field1,field2,field3,field4
Procedure evButton(*button.PB_FORM::GadgetButton)
  Debug "You're clicked on the button "+*button\getTitle()
EndProcedure

Procedure evChange(*string.PB_FORM::GadgetString)
  Debug *string\getValue()
EndProcedure

Procedure openMainForm()
  UseModule PB_FORM
  ; open window
  mainForm = newForm(0,0,800,0,"Example 10 ")
  ; for close application
  mainForm\setMainForm(#True)
  mainForm\setFlags(#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
  ; set min value for main windows
  Define sizes.sizes = mainForm\getSize() : sizes\setMinHeight(300) : sizes\setMinWidth(400)
  ; use HLayout as main layout
  mainLayout.HLayout = mainForm\setMainLayout(newHLayout())
  ; we will expand the left layout
  mainLayout\setExpand(1)
  ; we create the left layout into the main layout
  Define leftLayout.VLayout = mainLayout\addContent(newVLayout())
  leftLayout\setExpand(#LAYOUT_EXPAND_YES)
  leftLayout\setSpace(15)
  ; we add string gadget
  Define   frame.GadgetFrame = leftLayout\addContent(newGadgetFrame("Field 1"))
  field1 = frame\setContent(newGadgetString())
  
  
  Define   frame.GadgetFrame = leftLayout\addContent(newGadgetFrame("Field 2"))
  field2 = frame\setContent(newGadgetString())
  
  
  Define   frame.GadgetFrame = leftLayout\addContent(newGadgetFrame("Field 3"))
  field3 = frame\setContent(newGadgetString())
  
  
  Define   frame.GadgetFrame = leftLayout\addContent(newGadgetFrame("Field 4"))
  field4 = frame\setContent(newGadgetString())

  
  ; we create the right layout
  Define rightLayout.VLayout = mainLayout\addContent(newVLayout())
  ; we add button into the right layout
  Define bt.GadgetButton = rightLayout\addContent(newGadgetButton("New",newListener(@evButton())))
  bt\setSizes(100,0)
  rightLayout\addContent(newGadgetButton("Edit",newListener(@evButton())))
  rightLayout\addContent(newGadgetButton("Delete",newListener(@evButton())))
  Define e.Empty = rightLayout\addContent(newEmpty())
  Define s.Sizes = e\getSizes() : s\setHeight(40)
  rightLayout\addContent(newGadgetButton("Exit",newListener(@evButton())))
  
  ; open window
  mainForm\open()
EndProcedure

openMainForm()

Repeat 
  WaitWindowEvent()
ForEver
Image

Code exemple version BETA 1.5 EX8.pb

Code : Tout sélectionner

;*********************************************************************************************************************************************
; AUTHOR   : microdevWeb
; MODULE   : PB_FORM
; VERSION  : BETA 1.5
; LICENCE  : MIT
; EXAMPLE  : use Layout and string gadget
;*********************************************************************************************************************************************
XIncludeFile "../PB_FORM/Include/PB_FORM.pbi"
Global mainForm.PB_FORM::Form 

Procedure evButton(*button.PB_FORM::GadgetButton)
  Debug "You're clicked on the button "+*button\getTitle()
EndProcedure

Procedure evChange(*string.PB_FORM::GadgetString)
  Debug *string\getValue()
EndProcedure

Procedure openMainForm()
  UseModule PB_FORM
  ; open window
  mainForm = newForm(0,0,800,0,"Example 8 use HLayout and VLayout with button and String gadget")
  mainForm\setMainForm(#True)
  Define flag.FormFlags = mainForm\getFlag()
  flag\setScreenCentered(#True)
  flag\setSizeGadget(#True)
  ; use HLayout as main layout
  mainLayout.HLayout = mainForm\setMainLayout(newHLayout())
  ; we will expand the left layout
  mainLayout\setExpand(1)
  ; we create the left layout into the main layout
  Define leftLayout.VLayout = mainLayout\addContent(newVLayout())
  leftLayout\setExpand(#LAYOUT_EXPAND_YES)
  leftLayout\setSpace(15)
  ; we add string gadget
  Define string.GadgetString = leftLayout\addContent(newGadgetString("Field 1"))
  String\setChangeListener(newListener(@evChange()))
  
  leftLayout\addContent(newGadgetString("Field 2"))
  Define string.GadgetString = leftLayout\addContent(newGadgetString("PassWord"))
  Define sflag.PB_FORM::StringFlags = String\getFlags() : sflag\setPassword(#True)
  Define string.GadgetString =leftLayout\addContent(newGadgetString("Border less"))
  Define sflag.PB_FORM::StringFlags = String\getFlags() : sflag\setBorderLess(#True)
  ; we create the right layout
  Define rightLayout.VLayout = mainLayout\addContent(newVLayout())
  ; we add button into the right layout
  Define bt.GadgetButton = rightLayout\addContent(newGadgetButton("New",newListener(@evButton())))
  Define btSize.Sizes = bt\getSizes() : btSize\setWidth(100)
  rightLayout\addContent(newGadgetButton("Edit",newListener(@evButton())))
  rightLayout\addContent(newGadgetButton("Delete",newListener(@evButton())))
  Define e.Empty = rightLayout\addContent(newEmpty())
  Define s.Sizes = e\getSizes() : s\setHeight(40)
  rightLayout\addContent(newGadgetButton("Exit",newListener(@evButton())))
  
  ; open window
  mainForm\open()
EndProcedure

openMainForm()

Repeat 
  WaitWindowEvent()
ForEver
Image

Code exemple version BETA 1.4:

Code : Tout sélectionner

;*********************************************************************************************************************************************
; AUTHOR   : microdevWeb
; MODULE   : PB_FORM
; VERSION  : BETA 1.4
; LICENCE  : MIT
; EXAMPLE  : use Layout
;*********************************************************************************************************************************************
XIncludeFile "../PB_FORM/Include/PB_FORM.pbi"
Global mainForm.PB_FORM::Form 

Procedure evButton(*button.PB_FORM::GadgetButton)
  Debug "You're clicked on the button "+*button\getTitle()
EndProcedure

Procedure openMainForm()
  UseModule PB_FORM
  ; open window
  mainForm = newForm(0,0,800,0,"Example 7 use HLayout and VLayout")
  mainForm\setMainForm(#True)
  Define flag.FormFlags = mainForm\getFlag()
  flag\setScreenCentered(#True)
  flag\setSizeGadget(#True)
  ; use HLayout as main layout
  mainLayout.HLayout = mainForm\setMainLayout(newHLayout())
  ; we will expand the left layout
  mainLayout\setExpand(1)
  ; we create the left layout into the main layout
  Define leftLayout.VLayout = mainLayout\addContent(newVLayout())
  leftLayout\setAlignement(#ALIGN_CENTER)
  ; we add button like field
  leftLayout\addContent(newGadgetButton("Field 1",newListener(@evButton())))
  leftLayout\addContent(newGadgetButton("Field 2",newListener(@evButton())))
  leftLayout\addContent(newGadgetButton("Field 3",newListener(@evButton())))
  leftLayout\addContent(newGadgetButton("Field 4",newListener(@evButton())))
  ; we create the right layout
  Define rightLayout.VLayout = mainLayout\addContent(newVLayout())
  ; we add button into the right layout
  Define bt.GadgetButton = rightLayout\addContent(newGadgetButton("New",newListener(@evButton())))
  Define btSize.Sizes = bt\getSizes() : btSize\setWidth(100)
  rightLayout\addContent(newGadgetButton("Edit",newListener(@evButton())))
  rightLayout\addContent(newGadgetButton("Delete",newListener(@evButton())))
  Define e.Empty = rightLayout\addContent(newEmpty())
  Define s.Sizes = e\getSizes() : s\setHeight(40)
  rightLayout\addContent(newGadgetButton("Exit",newListener(@evButton())))
  
  ; open window
  mainForm\open()
EndProcedure

openMainForm()

Repeat 
  WaitWindowEvent()
ForEver

Re: Module PB_FORM

Publié : mar. 19/janv./2021 17:19
par Shadow
Merci à toi, je suis ça :)

Re: Module PB_FORM

Publié : mer. 20/janv./2021 11:00
par Mesa
A terme, ça vaudrait le coup de faire un wizzard comme avec dialogdesign0r, ici https://www.purebasic.fr/english/viewto ... lit=hex0rs ou même de l'intégrer dedans sous forme de plugin...

J'ai un bug bizarre dans l'exemple 1 ou le "flag\setMaximizeGadget(#True)" ne fonctionne pas, la fenêtre s'agrandie mais pas complètement. Par contre pas de bug dans les autres exemples (en ajoutant cette ligne de code).

pb 573 32b.

M.

Re: Module PB_FORM

Publié : mer. 20/janv./2021 11:12
par microdevweb
@Mesa,

J'ai réfléchi à la possibilité d'utiliser les dialogues, je vais peut-être tester dans ce sens, car la je l'avoue je suis mal engagé avec les layouts en utilisant des container.

Merci pour ta réflexion.

Re: Module PB_FORM

Publié : jeu. 21/janv./2021 11:13
par microdevweb
version BETA 1.4 is out
please try only EX_7.pb

Re: Module PB_FORM

Publié : ven. 22/janv./2021 14:17
par microdevweb
BETA 1.7 is out

Re: Module PB_FORM

Publié : sam. 23/janv./2021 10:37
par microdevweb
BETA 1.9 is out

Re: Module PB_FORM

Publié : sam. 23/janv./2021 15:42
par Micoute
C'est très bon ça, merci pour le partage.

Re: Module PB_FORM

Publié : dim. 24/janv./2021 5:22
par microdevweb
BETA 1.10 is out

Re: Module PB_FORM

Publié : mar. 26/janv./2021 10:59
par Kwai chang caine
Eh ben...tu chaumes pas 8O
Merci pour les partages 8)