PureFORM 1.99 (yet another FORM designer)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

kanjia
New User
New User
Posts: 1
Joined: Thu Sep 30, 2010 2:08 am

Re: PureFORM 1.99 (yet another FORM designer)

Post by kanjia »

Why does not provide multi-language software?
How to make a multi-language software?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by gnozal »

kanjia wrote:Why does not provide multi-language software?
How to make a multi-language software?
I don't understand what you mean ?
PureFORM has multi-language support : have a look at the 'Prepare multilanguage support' item in the preferences.
However, PureFORM does not support unicode (it's an ANSI executable).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by Kukulkan »

Hi gnozal,

I use PureFORM to design a GUI that utilizes the Scintilla gadget. I configured PureForm not to insert

Code: Select all

Procedure ScintillaCallBack(Gadget, *scinotify.SCNotification)
EndProcedure
into the code, because I want to do this procedure in another include-file in my project.

I removed the content of InitCode in the PureFORM configuration, but the created source keeps containing the code. In the configuration for the Scintilla Gadget definitely is no more code for this, but it is allways integrated in the created source. What is wrong?

Kukulkan
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by gnozal »

Kukulkan wrote: I use PureFORM to design a GUI that utilizes the Scintilla gadget. I configured PureForm not to insert

Code: Select all

Procedure ScintillaCallBack(Gadget, *scinotify.SCNotification)
EndProcedure
into the code, because I want to do this procedure in another include-file in my project.
I removed the content of InitCode in the PureFORM configuration, but the created source keeps containing the code. In the configuration for the Scintilla Gadget definitely is no more code for this, but it is allways integrated in the created source. What is wrong?
The modified custom gadget configuration applies to the newly created gadgets.
To apply them to existing gadgets :
- load your project.
- go to custom gadget configuration in Preferences.
- select 'Scintilla Gadget'.
- click on the 'Update project' button and confirm.
- your project scintilla gadgets should have been updated with the new configuration.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by Kukulkan »

Hi gnozal,

Thank you for the quick reply. I try'd the "Update project" button several times before (and now again) with no success. The code stays in the project - even if there is nothing in the InitCode field :|

Kukulkan
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by gnozal »

Kukulkan wrote:I try'd the "Update project" button several times before (and now again) with no success. The code stays in the project - even if there is nothing in the InitCode field :|
Now that's odd.
I just tried and it works here !
Did you rename the custom gadget ('Name' field in properties) ? PureFORM relies on the gadget name to identify the gadget.

You can still modify your project by hand. Open the .pbf in an editor, locate the 'Custom Gadget¶' lines, remove the init code.
Example :
  before : 'Custom Gadget¶...........¶0¶ScintillaGadget·If InitScintilla("Scintilla.dll") = 0\n End\nEndIf\nProcedure ScintillaCallBack(Gadget, *scinotify.SCNotification)\nEndProcedure·ScintillaGadget(%id%, %x%, %y%, %w%, %h%, @ScintillaCallback())···ScintillaGadget [Scintilla Library, Purebasic 4.10+]¶....'
  after : 'Custom Gadget¶...........¶0¶ScintillaGadget··ScintillaGadget(%id%, %x%, %y%, %w%, %h%, @ScintillaCallback())···ScintillaGadget [Scintilla Library, Purebasic 4.10+]¶....'
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by Kukulkan »

Hi,

No, the CustomGadget property "name" has not been changed. The only property I changed (deleted) was "InitCode".

After inserting, I changed the Enum-field to "#sciMessageBody" in the PureFORM editor. Nothing more has been done with this gadget...

It works after direct manipulation of the project-file. Thank you. :)

Kukulkan
michel
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Feb 19, 2007 5:47 pm
Location: Luxemburg

Re: PureFORM 1.99 (yet another FORM designer)

Post by michel »

Hi Gnozal,

The PANEL gadget still creates a gadget list

michel
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by gnozal »

michel wrote:Hi Gnozal,
The PANEL gadget still creates a gadget list
michel
Hi michel,
I don't understand what you mean ?
Here is the generated code :

Code: Select all

    PanelGadget(#Panel_5, 15, 285, 370, 155)
      AddGadgetItem(#Panel_5, -1, "Tab #1")
      AddGadgetItem(#Panel_5, -1, "Tab #2")
      AddGadgetItem(#Panel_5, -1, "Tab #3")
    CloseGadgetList()
Seems correct to me.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
michel
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Feb 19, 2007 5:47 pm
Location: Luxemburg

Re: PureFORM 1.99 (yet another FORM designer)

Post by michel »

Hello Gnozal,

I meant this warning by the compiler:

"deprecated function CreateGadgetList() is used"

Michel
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by gnozal »

michel wrote:Hello Gnozal,
I meant this warning by the compiler:
"deprecated function CreateGadgetList() is used"
Michel
PureFORM only uses CreateGadgetList() if the detected PB compiler version is < 4.30 or no compiler could be found.
What PB version does PureFORM report in the 'About' menu ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
michel
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Feb 19, 2007 5:47 pm
Location: Luxemburg

Re: PureFORM 1.99 (yet another FORM designer)

Post by michel »

Hi Gnozal,

You are right, I realized that the problem only occurs when I am working with the USB-stick (portable) version. How can I manage that Pureform recognizes the compiler version on the stick?

Michel
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by gnozal »

michel wrote:You are right, I realized that the problem only occurs when I am working with the USB-stick (portable) version. How can I manage that Pureform recognizes the compiler version on the stick?
Assuming PB is on the USB stick, you may change the compiler path in Menu : Setup -> Configuration -> Code (or edit manually PureFORM.ini, like "FORM_CompilerPath = \PureBasic\Compilers\PBCompiler.exe" ).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

Re: PureFORM 1.99 (yet another FORM designer)

Post by Vitor_Boss® »

Can I suggest a update to your app?
I found a bug when the toolbar button text use Russian characters, so I wrote a single procedure to check if the string is Unicode.

Code: Select all

Procedure IsUnicode(String.s)
   Protected.l i, bLen
   Protected Dim Mapp.a(0)
   If Len(String)
     ReDim Mapp(StringByteLength(String))
     CopyMemory(@String, @Mapp(0), StringByteLength(String))
      bLen = ArraySize(Mapp())
      For i = 1 To bLen Step 2
         If (Mapp(i) > 0)
            ProcedureReturn #True            
         EndIf
      Next
   EndIf
EndProcedure
Procedure.l SetToolbarItemText(Toolbar.l, ToolbarItem.l, Text.s, IconSizeX.l)
  Protected i.l, hdc.l, hToolbar.l, ButtonInfo.TBBUTTONINFO, Size.SIZE , hFont.l, hFontOld.l
  Static FakeButtonStrings.s
  If FakeButtonStrings = ""
    CompilerIf #PB_Compiler_Unicode
      FakeButtonStrings = Space(512)
      For i = 1 To 510 Step 2
        PokeW(@FakeButtonStrings + i, 0)
      Next
      PokeW(@FakeButtonStrings + 511, 0)
    CompilerElse
      FakeButtonStrings = Space(256)
      For i = 1 To 255 Step 2
        PokeB(@FakeButtonStrings + i, 0)
      Next
      PokeB(@FakeButtonStrings + 256, 0)
    CompilerEndIf
  EndIf
  hToolbar = ToolBarID(Toolbar)
  If hToolbar
    ButtonInfo\cbSize = SizeOf(TBBUTTONINFO)
    ButtonInfo\dwMask = #TBIF_TEXT | #TBIF_COMMAND |#TBIF_SIZE
    ButtonInfo\pszText = @Text
    ButtonInfo\idCommand = ToolbarItem
    hdc = GetDC_(hToolbar) 
    If hdc
      hFont = SendMessage_(hToolbar, #WM_GETFONT, 0, 0)
      hFontOld = SelectObject_(hdc, hFont)
      CompilerIf #PB_Compiler_Unicode
        If IsUnicode(Text) 
          GetTextExtentPoint32_(hdc, Text, StringByteLength(Text, #PB_UTF8)/2, @Size)
        Else
          GetTextExtentPoint32_(hdc, Text, StringByteLength(Text, #PB_UTF8), @Size)
        EndIf  
      CompilerElse
        GetTextExtentPoint32_(hdc, Text, StringByteLength(Text, #PB_Ascii), @Size)
      CompilerEndIf
      ButtonInfo\cx = Size\cx + 10
      IconSizeX + 10
      If ButtonInfo\cx < IconSizeX
        ButtonInfo\cx = IconSizeX
      EndIf
      SelectObject_(hdc, hFontOld)
      ReleaseDC_(hToolbar, hdc)
    EndIf
    If FakeButtonStrings
      SendMessage_(hToolbar, #TB_ADDSTRING, 0, @FakeButtonStrings)
    EndIf
    SendMessage_(hToolbar, #TB_SETBUTTONINFO, ToolbarItem, @ButtonInfo)
    SendMessage_(hToolbar, #TB_AUTOSIZE, 0, 0)
  EndIf
EndProcedure
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureFORM 1.99 (yet another FORM designer)

Post by gnozal »

Vitor_Boss® wrote:I found a bug when the toolbar button text use Russian characters, so I wrote a single procedure to check if the string is Unicode.
It should be fixed.
(It now generates GetTextExtentPoint32_(hdc, Text, Len(Text), @Size), which should be ok for all modes).
PureFORM download updated. (build 406).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply