Re: PureFORM 1.99 (yet another FORM designer)
Posted: Thu Sep 30, 2010 2:12 am
Why does not provide multi-language software?
How to make a multi-language software?
How to make a multi-language software?
http://www.purebasic.com
https://www.purebasic.fr/english/
I don't understand what you mean ?kanjia wrote:Why does not provide multi-language software?
How to make a multi-language software?
Code: Select all
Procedure ScintillaCallBack(Gadget, *scinotify.SCNotification)
EndProcedure
The modified custom gadget configuration applies to the newly created gadgets.Kukulkan wrote: I use PureFORM to design a GUI that utilizes the Scintilla gadget. I configured PureForm not to insertinto the code, because I want to do this procedure in another include-file in my project.Code: Select all
Procedure ScintillaCallBack(Gadget, *scinotify.SCNotification) EndProcedure
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?
Now that's odd.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![]()
Hi michel,michel wrote:Hi Gnozal,
The PANEL gadget still creates a gadget list
michel
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()
PureFORM only uses CreateGadgetList() if the detected PB compiler version is < 4.30 or no compiler could be found.michel wrote:Hello Gnozal,
I meant this warning by the compiler:
"deprecated function CreateGadgetList() is used"
Michel
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" ).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?
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
It should be fixed.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.