Page 4 of 6
Posted: Wed May 28, 2008 12:19 am
by Mistrel
I understand now. I do call procedures from the same library that return a string for my error handler. I'm having trouble figuring out how to fix it because all of the output is getting messed up because of the changes to the OnError library:
http://www.purebasic.fr/english/viewtop ... 692#245692
Is there any way to fix it so you can call exported string functions from the same library? I'm afraid that this will create problems for the future.
Posted: Wed May 28, 2008 8:30 am
by srod
You just need to do what Gnozal has done and create some dummy functions. Exported string functions just wrap the appropriate dummy function. Any other library function needing to call the exported string function instead calls the dummy function directly.
Posted: Wed May 28, 2008 9:18 am
by Mistrel
srod wrote:You just need to do what Gnozal has done and create some dummy functions.
That might work if I knew how to solve this problem:
http://www.purebasic.fr/english/viewtopic.php?t=32606
These functions are completely bugged.
Posted: Thu Jun 12, 2008 6:55 pm
by Hurga
I switched to 4.2 and tried to tailbite a lib (which go well with 4.1 + tailbite).
The result is an error message...
Error at line 164: [ is not a valid argument type
(Line 164 ist "Endstructure" btw
Can someone help me / explain what this means ...
Thx
Posted: Fri Jun 13, 2008 9:50 am
by Progi1984
You had to show your lines for finding the problem in your lines or Tailbite...
Posted: Sun Jun 15, 2008 7:55 am
by Hurga
here is the code (partly)
Code: Select all
; This is the source for the Screengadgets - Lib
; Coded 2005-2006 by Dostej (Stefan Mahr) released under the LGPL
; version 1.2 for PB 4.0
;/ Preparation
Declare SG_FreeAllGadgets()
Declare SG_ClearGadgetItemList(SG_GadgetID_L.l)
Declare SG_AddGadgetItem(SG_GadgetID_L.l, Position_L.l, Text_S.s)
Declare SG_FillExplorerGadget(SG_GadgetID_L.l, Directory_S.s)
Declare SG_AddGadgetColumn(SG_GadgetID_L.l, Column_L.l, ColumnName_S.s, ColumnWidth_L.l)
Declare SG_Sort_ListIconGadget2(SG_GadgetID_L.l, Column_L.l, Typ_L.l, Options_L.l, Start_L.l, Stop_L.l)
#AsInclude = 0
;{ Constants for ScreenGadgets
CompilerIf #AsInclude ; wenn als Includefile
Enumeration 1 ; Gadget types
#SG_GadgetType_Text
#SG_GadgetType_String
#SG_GadgetType_Editor
#SG_GadgetType_Button
#SG_GadgetType_Checkbox
#SG_GadgetType_ComboBox
#SG_GadgetType_Option
#SG_GadgetType_Trackbar
#SG_GadgetType_Listicon
#SG_GadgetType_ScrollBar
#SG_GadgetType_Image
#SG_GadgetType_ButtonImage
#SG_GadgetType_Frame3D
#SG_GadgetType_ExplorerList
#SG_GadgetType_Spin
EndEnumeration
Enumeration 1 ; Event types
#SG_EventType_MouseOverGadget ; Mouse over the gadget
#SG_EventType_LeftClick ; Klick mit der linken Maustaste
#SG_EventType_RightClick ; Klick mit der rechten Maustaste
#SG_EventType_LeftRelease ; release Left Button
#SG_EventType_RightRelease ; release Right Button
; #SG_EventType_LeftDoubleClick ; Doppelklick mit der linken Maustaste
; #SG_EventType_RightDoubleClick ; Doppelklick mit der rechten Maustaste
#SG_EventType_Wheel
#SG_EventType_Change ; Inhal
#SG_EventType_Focus ; Focus erhalten
#SG_EventType_LostFocus ; Focus verloren
EndEnumeration
CompilerEndIf
#SG_FontStandard = 2
#SG_FontSymbol = 1
#Col_Disabled = $808080
#Col_GadgetHeader = $C0C0C0
#Col_StateMark = $0000FF
#Col_Cursor = $808080
Enumeration 1
#SG_Explorer_Name ; displays the name of the file/directory
#SG_Explorer_Size ; displays the filesize in Kb
#SG_Explorer_Type ; displays a string describing the filetype
#SG_Explorer_Attributes ; displays the Attributes of the file/directory
#SG_Explorer_Created ; displays the time the file/directory was created
#SG_Explorer_Modified ; displays the time the file/directory was last modified
#SG_Explorer_Accessed
EndEnumeration
;}
; Data for the ScreenGadgets
ProcedureDLL PBOSL_Screengadgets_Init()
Global SG_MouseX_GL.l ; contains the mouse coord.
Global SG_MouseY_GL.l
Global SG_MouseButton_GL.l ; contains the mousebutton state
Global SG_MouseWheel_GL.l ; contains the mousewheel value
Global SG_StandardColor_GL.l ; the text color of the gadgets
Global SG_StandardBackground_GL.l ; contains the standard background
Global SG_StandardBackgroundData_GL.l ; contains the standard background data (color or imagenr)
Global SG_FontStandard_GL.l ; contais the standard font nummer
Global SG_StandardHeaderTextColor_GL.l ; the Color values for the header and the Gridlines
Global SG_StandardHeaderBackColor_GL.l
Global SG_StandardLineColor_GL.l
Global SG_StandardDisabled_GL.l
Global SG_EventType_GL.l ; type of the event happened
Global SG_CurrentGadget_GL.l ; the ID of the gadget where the actual event is happened
Global SG_FocusGadget_GL.l ; The number of the gadget with the Focus or -1 for non
Global SG_Group_GL.l ; actual groupnumber for Optiongadgets or -1, if no actual group exist
Global MoveLIcon_Header_GL.l ; is set to the left header, if between two Header-seqments << 16 | (Mousebutton)
Global SG_ToolTipDelayTime_GL.l = 150 ; the delay time to show the tooltips
Global SG_ShowToolTip_GL.l = -1 ; if <> -1 = gadgetnr to show the tooltip
Structure GadgetBase
SG_GadgetID_L.l ; The number of the Gadget (given by the user)
GadgetID_P.l ; the ID of the Gadget = pointer of the element of the correponding list
GadgetType_L.l ; the typ of the gadget -> see constants for reference
AddList_P.l; contains a pointer to the linked element of the typ of the gadget
X_Pos_L.l ; the xpos of the Gadget
Y_Pos_L.l ; the ypos of the Gadget
Width_L.l ; the widht of the Gadget
Height_L.l ; the height of the Gadget
Hidden_L.l ; 0 = visible
Disabled_L.l; 0 = enabled
TextColor_L.l ; the text color of the Gadget
DisabledColor_L.l ; text colot for disabled-mode
BackGround_L.l ; how to handle the background 0 = no Background 1= Color 2 = image
BackGroundDetail_L.l ; contains the color / imagenumber for the background
Data_L.l ; store the assigned data
ToolTip_S.s ; stores the Tooltip for this gadget
EndStructure
Structure TextGadget
GadgetID_P.l ; the ID of the Item of the basic gadget list
Text_S.s ; the text of the Textgadget
TextFont_L.l
Flags_L.l ; contains the Display-Flags
CursorPos_L.l ; at what position is the cursor
CursorMode_L.l ; 0 = insert 1 = overwrite
EndStructure
Structure SpinGadget
GadgetID_P.l ; the ID of the Item of the basic gadget list
Value_L.l ; the value of the spingadget
Text_S.s ; may be independent from the Value (State)
Minimum_L.l ; min and max value of the spingadget
Maximum_L.l
TextFont_L.l
Flags_L.l ; contains the Display-Flags
CursorPos_L.l ; at what position ist the cursor
CursorMode_L.l ; 0 = insert 1 = overwrite
EndStructure
Structure EditorGadget
GadgetID_P.l ; the ID of the Item of the basic gadget list
ItemMem_P.l ; a pointer to memory, which stores the Pointers to the Structure EditorItems
SpriteID_L.l ; the ID of the sprite to render to
; Text_S.s ; the text of the Textgadget
Flags_L.l ; contains the Display-Flags
TextFont_L.l ; the standard font for this gadget
PageLenghtVertical_L.l ; the virtual size of all the data to show
ScrollbarVertical_L.l ; 0, if there is no vertical scrollbar, otherwise the pointer to the scrollbar-listelement
PageLenghtHorizontal_L.l ; the virtual size of all the data to show
ScrollbarHorizontal_L.l ; 0, if there is no horizontal scrollbar, otherwise the pointer to the scrollbar-listelement
CursorPos_L.l ; at what position ist the cursor
CursorMode_L.l ; 0 = insert 1 = overwrite
CursorLine_L.l ; in what line is the cursor
EndStructure
Structure EditorItems
Item_S.s ; limit the items per list
ItemState_L.l ; the state of the item
ItemFont_L.l ; the FontID of the item
ItemSize_L.l ; the y-size of the text
RowColor_L.l ; the color of the row or -1 for standard
RowTextColor_L.l ; the color of the text of the row or -1 for standard
EndStructure
Structure ButtonGadget
GadgetID_P.l ; the ID of the Item of the basic gadget list
Text_S.s ; the text of the Buttongadget
TextFont_L.l
Toggle_L.l ; if 0, just clicks, if 1, Buttons keeps its state
Toggle_State_L.l ; if it is a toggle-button, it keeps the toggle-state (1 = pressed)
Flags_L.l ; contains the Display-Flags
EndStructure ; << this is line 164
Structure CheckBoxGadget
GadgetID_P.l ; the ID of the Item of the basic gadget list
Text_S.s ; the text of the Checkboxgadget
TextFont_L.l
Status_L.l
Flags_L.l ; contains the Display-Flags
EndStructure
Posted: Tue Jun 24, 2008 9:21 pm
by ABBKlaus
@Hurga,
your snippet is working correct with PB4.20.
Please provide full code of the lib (PM), or i can´t help.
Posted: Wed Jun 25, 2008 8:27 pm
by Hurga
The code is a bit long here...
Maybe the easiest way is to download it from the PBOSL... (its the screengadget lib).
Posted: Wed Jun 25, 2008 9:10 pm
by ABBKlaus
Posted: Wed Jun 25, 2008 10:42 pm
by Hurga
Hm, strange.. I used the same version von PB and Tailbite.. and every time a got this nice error...
Hm, let my try a bit.. (may take some time...)
Thx a lot for now...
Posted: Fri Jun 27, 2008 5:16 pm
by mback2k
Removed Plugins (not working in PB4.xx):
- TB_GadgetExtension
Does this mean that there is no way to create "real" PureBasic like Gadgets with Tailbite at the moment?
I would like to create a gadget based upon the EditorGadget that will end up as a TextLinkGadget: (Multiline) Text with (multiple) links in it. (I already have the code to create and modify the EditorGadget, but I would like to wrap it in a Library to support the PB Gadget procedures.)
All the example codes I found were undocumented and looked unstructured.
Thanks in advance!
Posted: Fri Jun 27, 2008 8:00 pm
by ABBKlaus
mback2k wrote:Does this mean that there is no way to create "real" PureBasic like Gadgets with Tailbite at the moment?
No, i did only remove code thats not working with newer versions of PureBasic.
If you are looking for better commented code take a look at srod´s collection of custom gadgets
nexus.
It can be found here :
http://www.nxsoftware.com/
forum thread :
http://www.purebasic.fr/english/viewtopic.php?t=31381
Posted: Sun Jun 29, 2008 12:43 pm
by mback2k
Hm, I did take a look at it. That's not really what I would like to create. I would like my Gadget to work the same way as the PureBasic ones do.
One command to create the Gadget and everything else should be done through the existing PureBasic commands. Like it was possible with "older" PureBasic versions. Is there no way to create Gadgets that way with PB 4.20?
Posted: Mon Jun 30, 2008 6:05 pm
by ABBKlaus
You could take a look into the Library SDK folder of your PureBasic installation directory. There is a SampleGadget plugin somewhere.
Posted: Mon Jun 30, 2008 6:30 pm
by ts-soft
There is a userlib in PBOSL to create gadgets