Includefile for creating real Gadgets in PB
Update:
you can create Gadget in Unicode and/or Threadsafe-mode !
Scintilla-Example Updated
you can create Gadget in Unicode and/or Threadsafe-mode !
Scintilla-Example Updated
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

It's only an example, isn't complete!Num3 wrote:Just a small note, i've noticed radgrid doesn't sort #TYPE_USER columns..
Bug or feature?
You can enhanced it. When you post the code here, i will
include it

Only scintilla and the simple controls a complete, i hope
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Resources for RaEdit and RaGrid as *.res added. So no problems with Path in RC-Skript
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Thanks for a great lib ts-soft.
A question though:
If you create a new gadget and supply a pointer to a PB_GadgetVT structure, but only implement a few of the functions; what happens regarding the ones I did not define?
For example, suppose I only implement a FreeGadget() procedure, and leave all remaining pointers within the PB_GadgetVT structure null, does that mean that all the remaining functions, such as ResizeGadget(), will not function, or do they default to some pre-defined procedure?
Thanks.

A question though:
If you create a new gadget and supply a pointer to a PB_GadgetVT structure, but only implement a few of the functions; what happens regarding the ones I did not define?
For example, suppose I only implement a FreeGadget() procedure, and leave all remaining pointers within the PB_GadgetVT structure null, does that mean that all the remaining functions, such as ResizeGadget(), will not function, or do they default to some pre-defined procedure?
Thanks.
I may look like a mule, but I'm not a complete ass.
All Gadget become some standard-actions from PB. FreeGadget, ResizeGadget, SetGadgetText an so on, working without any line of code, but you can overwrite this.
This is a feature bei PureBASIC, not by hallodri and me
This is a feature bei PureBASIC, not by hallodri and me

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

for problems with RaGrid example read this: http://www.purebasic.fr/english/viewtop ... &start=105
This project is published in pbosl as PBOSL_CreateGadget lib
The version in pbosl has some bugfixes and support unicode.
This project is published in pbosl as PBOSL_CreateGadget lib
The version in pbosl has some bugfixes and support unicode.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Which field of the structure PB_GadgetVT must i use for using AddGadgetItem with a new gadget ?
???AddGadgetItem2.l???
???AddGadgetItem3.l???
???AddGadgetColumn???
??? an other ???
???AddGadgetItem2.l???
???AddGadgetItem3.l???
???AddGadgetColumn???
??? an other ???
Code: Select all
Structure PB_GadgetVT
GadgetType.l
SizeOf.l
GadgetCallback.l
FreeGadget.l
GetGadgetState.l
SetGadgetState.l
GetGadgetText.l
SetGadgetText.l
AddGadgetItem2.l
AddGadgetItem3.l
RemoveGadgetItem.l
ClearGadgetItemList.l
ResizeGadget.l
CountGadgetItems.l
GetGadgetItemState.l
SetGadgetItemState.l
GetGadgetItemText.l
SetGadgetItemText.l
OpenGadgetList2.l
GadgetX.l
GadgetY.l
GadgetWidth.l
GadgetHeight.l
HideGadget.l
AddGadgetColumn.l
RemoveGadgetColumn.l
GetGadgetAttribute.l
SetGadgetAttribute.l
GetGadgetItemAttribute2.l
SetGadgetItemAttribute2.l
SetGadgetColor.l
GetGadgetColor.l
SetGadgetItemColor2.l
GetGadgetItemColor2.l
SetGadgetItemData.l
GetGadgetItemData.l
EndStructure
See the PureBasic.chm: How many optional parameters are used?
Using all = AddGadgetItem3
Using without Flags = AddGadgetItem2
and so on
Code: Select all
Result = AddGadgetItem(#Gadget, Position, Text$ [, ImageID [, Flags]])
Using without Flags = AddGadgetItem2
and so on
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

@drahneir
Not testet
Regards
Thomas
Code: Select all
Procedure MyGadgetState(Gadget, State)
ProcedureReturn SendMessage_(Gadget, #BM_SETCHECK, 1, 0)
EndProcedure
Procedure MyGadget(...)
Protected vt.PB_GadgetVT
vt\SetGadgetState = @MyGadgetState()
CreateGadget(..., @vt)
EndProcedure
Regards
Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Hi ts-soft, a small question :
I do a gadget and use AddGadgetItem
So for AddGadgetItem2, i use this code :
but when i use this code :
For the first addGadgetItem, i have ImageID = 0 and Flags = 0
For the second addGadgetItem, i have ImageID = 0 and Flags = 0
But if i understand, i would have to receive theses results :
For the first addGadgetItem, i have ImageID = -1 and Flags = -1
For the second addGadgetItem, i have ImageID = 0 and Flags = 0
What is my problem ?
I do a gadget and use AddGadgetItem
So for AddGadgetItem2, i use this code :
Code: Select all
Procedure OB_AddGadgetItem2 (*gadget.PB_Gadget, Position, Texte.s)
ProcedureReturn OB_AddGadgetItem3(*gadget, Position, Texte.s, -1, -1)
EndProcedure
Code: Select all
AddGadgetItem(10, 02, "Truc5")
AddGadgetItem(10, 00, "Truc00", 0, 0)
For the second addGadgetItem, i have ImageID = 0 and Flags = 0
But if i understand, i would have to receive theses results :
For the first addGadgetItem, i have ImageID = -1 and Flags = -1
For the second addGadgetItem, i have ImageID = 0 and Flags = 0
What is my problem ?
Please see in the PB SDK and in the examples, the comes with this lib.
Please, use the actuell version from PBOSL, this version is outdated and no
more supported.
I can't see a bug, should work, i think the bug isn't in the posted code
Please, use the actuell version from PBOSL, this version is outdated and no
more supported.
I can't see a bug, should work, i think the bug isn't in the posted code
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

For infos, i use the PBOSL version ! (Good job
)
With ths structure :
AddGadgetItem2.l => When no flags
AddGadgetItem3.l => When all flags !
So it's why i ask me if i understand all !

With ths structure :
Code: Select all
Structure PB_GadgetVT
GadgetType.l
SizeOf.l
GadgetCallback.l
FreeGadget.l
GetGadgetState.l
SetGadgetState.l
GetGadgetText.l
SetGadgetText.l
AddGadgetItem2.l
AddGadgetItem3.l
RemoveGadgetItem.l
ClearGadgetItemList.l
ResizeGadget.l
CountGadgetItems.l
GetGadgetItemState.l
SetGadgetItemState.l
GetGadgetItemText.l
SetGadgetItemText.l
OpenGadgetList2.l
GadgetX.l
GadgetY.l
GadgetWidth.l
GadgetHeight.l
HideGadget.l
AddGadgetColumn.l
RemoveGadgetColumn.l
GetGadgetAttribute.l
SetGadgetAttribute.l
GetGadgetItemAttribute2.l
SetGadgetItemAttribute2.l
SetGadgetColor.l
GetGadgetColor.l
SetGadgetItemColor2.l
GetGadgetItemColor2.l
SetGadgetItemData.l
GetGadgetItemData.l
EndStructure
AddGadgetItem3.l => When all flags !
So it's why i ask me if i understand all !