Page 84 of 103

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Thu Sep 30, 2010 2:12 am
by kanjia
Why does not provide multi-language software?
How to make a multi-language software?

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Tue Oct 12, 2010 11:05 am
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).

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Wed Oct 27, 2010 12:06 pm
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

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Wed Oct 27, 2010 1:25 pm
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.

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Wed Oct 27, 2010 1:51 pm
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

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Wed Oct 27, 2010 2:05 pm
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+]¶....'

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Thu Oct 28, 2010 7:24 am
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

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Sat Oct 30, 2010 3:29 pm
by michel
Hi Gnozal,

The PANEL gadget still creates a gadget list

michel

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Wed Nov 03, 2010 1:19 pm
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.

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Thu Nov 04, 2010 11:24 am
by michel
Hello Gnozal,

I meant this warning by the compiler:

"deprecated function CreateGadgetList() is used"

Michel

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Thu Nov 04, 2010 11:33 am
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 ?

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Thu Nov 04, 2010 5:24 pm
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

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Fri Nov 05, 2010 8:44 am
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" ).

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Wed Nov 10, 2010 11:15 pm
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

Re: PureFORM 1.99 (yet another FORM designer)

Posted: Thu Nov 11, 2010 11:47 am
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).