Page 1 of 1

[IDE] PB Custom Designer

Posted: Mon Jan 21, 2013 5:45 am
by eddy
It's an external tool to extend PB Editor. The idea is to make easier the creation of integrated custom designers (like FormDesigner)

For the moment, it's an alpha verison:
:arrow: PBCustomDesigner
(PB 3.50b3 - win x64)

Todo:
- read/write function
- synchronization system between designer view and file content (undo / redo / save / load )

How to configure this tool:
1- unzip file
2- register a new tool for auto start:
  • name: PB Custom Designer - Auto Start
  • CommandLine : PBCustomDesigner.exe
  • Arguments: "%FILE"
  • Event to trigger the tool : Sourcecode loaded
  • Checked option : Wait until tool quits
Image

3- register an other tool to toggle between code view and design view:
  • name: PB Custom Designer - Switch Code/Design View
  • CommandLine : PBCustomDesigner.exe
  • Arguments: "%FILE"
  • Event to trigger the tool : Menu or Shortcut
  • Checked option : Wait until tool quits
  • Shortcut : CTRL+T (choose your shortcut here...)
Image


Designer Logger Window
- This window manages all designer views
- If you close this window, the tool will stop
- show call stack trace

Image

Sample:
- This is a custom designer for ".material" files, it remplaces the default PB code editor.
- Its source code of this example is provided
Image

Re: [IDE] PB Custom Designer

Posted: Wed Jan 30, 2013 11:29 pm
by eddy
updated
- changed : option "Wait until tool quits"
- added : example to create a custom designer for .Material files
- added : logger window
- added : loading custom designer DLL at start
- improved : stability & loading speed
- improved : communication with PB Editor
- fixed : prevent IDE to open this tool twice (if empty source file is loaded)


Custom Designer template code:

Code: Select all

EnableExplicit

ProcedureDLL.s GetDesignerExtension()
   Static DesignerExtension.s="material"
   ProcedureReturn DesignerExtension
EndProcedure

ProcedureDLL.s GetDesignerDescription()
   Static DesignerDescription.s="Name=My Custom Designer|Author=YourName|Version=1.0|"
   ProcedureReturn DesignerDescription
EndProcedure

Structure CUSTOM_DESINGER_DATA
   myGadget1.i
   myGadget2.i
   myGadget3.i
   
   ; YOUR CUSTOM DATA HERE...
EndStructure


ProcedureDLL OpenDesigner(*parent, *scintilla)  
   Protected *designerData.CUSTOM_DESINGER_DATA=AllocateMemory(SizeOf(CUSTOM_DESINGER_DATA))
   With *designerData      
      UseGadgetList(*parent)
      Protected container=ContainerGadget(#PB_Any,0,0,300,300,#PB_Container_Single)
      If container      
         ; CREATE DESIGNER GADGETS HERE...
         
         CloseGadgetList()
      EndIf 
      CloseGadgetList()

      
      SetGadgetData(container,*designerData)
      ProcedureReturn container
   EndWith 
EndProcedure

ProcedureDLL CloseDesigner(container)   
   Protected *designerData.CUSTOM_DESINGER_DATA=GetGadgetData(container)
   With *designerData
      ; YOUR CODE HERE...
      FreeMemory(*designerData)
      FreeGadget(container)
      
   EndWith
EndProcedure

ProcedureDLL SynchronizeDesigner(container) 
   Protected *designerData.CUSTOM_DESINGER_DATA=AllocateMemory(SizeOf(CUSTOM_DESINGER_DATA))
   With *designerData
      ; YOUR CODE HERE...   
   EndWith   
EndProcedure 

ProcedureDLL HideDesigner(container,hidden)   
   Protected *designerData.CUSTOM_DESINGER_DATA=GetGadgetData(container)
   With *designerData
      ; YOUR CODE HERE...
   EndWith
EndProcedure

ProcedureDLL SizeDesigner(container,w,h)   
   Protected *designerData.CUSTOM_DESINGER_DATA=GetGadgetData(container)
   With *designerData
      ; YOUR CODE HERE...
   EndWith
EndProcedure

ProcedureDLL EventDesigner(container)   
   Protected *designerData.CUSTOM_DESINGER_DATA=GetGadgetData(container)
   With *designerData
      Protected event=WaitWindowEvent()
      Protected eventType=EventType()
      Protected eventGadget=EventGadget()
      
      ; YOUR GADGET EVENTS HERE...      
   EndWith 
EndProcedure 

Re: [IDE] PB Custom Designer

Posted: Sat Feb 02, 2013 3:03 pm
by eddy
updated
- added: second tool configuration to switch between code and design view

Todo
- fix shortcut handler
- fix MessageRequester handler

Re: [IDE] PB Custom Designer

Posted: Sun Feb 03, 2013 8:08 am
by electrochrisso
Hey eddy what does this mean (PB 3.50b3 - win x64) is it your custom designer version, and it only work on 64 bit. :?:

Re: [IDE] PB Custom Designer

Posted: Sun Feb 03, 2013 2:52 pm
by eddy
electrochrisso wrote:Hey eddy what does this mean (PB 3.50b3 - win x64) is it your custom designer version, and it only work on 64 bit. :?:
yes
But I can compile a 32bits version.

Re: [IDE] PB Custom Designer

Posted: Mon Feb 04, 2013 6:44 am
by electrochrisso
eddy wrote:
electrochrisso wrote:Hey eddy what does this mean (PB 3.50b3 - win x64) is it your custom designer version, and it only work on 64 bit. :?:
yes
But I can compile a 32bits version.
No hurry, don't forget to make a 32 bit version available too when you release the final though. :)