[Gambas-user] Set/GetProperty/Find Method feature request

Peter Bauer pebauer68 at gmail.com
Sat May 23 21:14:28 CEST 2020


Example what currently works:

rlwrap socat - tcp:localhost:9090       /* connect to Gambas  gui_server App
Set properties: name of object.property,string
e.g Button1.Text,123
Read properites: name of object - e.g. Button1
List objects: Press <q> <return>
q          #query all controls in a form works fine:
Objects:
 FMain
 HBox1
 TextBox1
 Button1
 Button2
 Button3
 HBox3
 TextLabel1
 HBox2
 TextArea1
 HBox4
 Button4
 Button5

Set a Property, query a property of a single GUI Object, works fine:
Textarea1.text,"test-text"     /* set
Textarea1.text                     /* query
"test-text"

Query all Properties of a GUI Object, here a Textarea again:
I only would need the Properties, not all symbols. Does not work as
expected.

For Each string$ In cls.Symbols
         Print "\nTRY: "; count; " ";
         If Not objname Then Print #rsock, "\nTRY: "; clsname; " "; count;
" ";
         Try result = Object.GetProperty(oo, string$)
             If result Not Begins ":" 'is an event !
                    Print "Symbol: "; string$; " Value: "; result; "";
                    If Not objname Then Print #rsock, "Symbol: "; string$;
" Value: "; result; "";
                    Endif
         If Error Then
           Print " Error: "; Error.code; " "; Error.Text; " ";
           Print #rsock, " Error: "; Error.code; " "; Error.Text; " ";
         Endif
         count += 1
     Next
     Print #rsock, "\n"
 End

.,H,W,X,Y,Id,Cut,Pos,Tag,Top,_new,Copy,Drag,Drop,Font,Grab,Hide,Left,Line,Move,Name,Next,Redo,Show,Text,Undo,Wrap,:Drag,:Drop,:Menu,Clear,Lower,Mouse,Paste,Proxy,Raise,ToPos,Width,:Enter,:Leave,Action,Border,Column,Cursor,Delete,Design,Expand,Handle,Height,Ignore,Insert,Length,Parent,Resize,Select,ToLine,Window,:Change,:Cursor,_Family,_Parent,Enabled,Hovered,Refresh,ScreenX,ScreenY,Tooltip,Visible,:MouseUp,_Similar,CursorAt,HasFocus,Previous,ReadOnly,Reparent,Selected,SetFocus,ToColumn,Tracking,Unselect,:DblClick,:DragMove,:GotFocus,:KeyPress,Alignment,PopupMenu,ScrollBar,SelectAll,Selection,:DragLeave,:LostFocus,:MouseDown,:MouseDrag,:MouseMove,_IsControl,Background,Foreground,MoveScaled,NoTabFocus,:KeyRelease,:MouseWheel,_Properties,_DefaultSize,ResizeScaled,_DefaultEvent,EnsureVisible,
Symbols found: 106

TRY: Textarea 0 Symbol: . Value:  Error: 14 'Button..' is static
TRY: Textarea 1 Symbol: H Value: 40
TRY: Textarea 2 Symbol: W Value: 128
TRY: Textarea 3 Symbol: X Value: 128
TRY: Textarea 4 Symbol: Y Value: 0
TRY: Textarea 5 Symbol: Id Value: 60817413
TRY: Textarea 6 Symbol: Cut Value: 60817413 Error: 11 Unknown symbol 'Cut'
in class 'Button'
TRY: Textarea 7 Symbol: Pos Value: 60817413 Error: 11 Unknown symbol 'Pos'
in class 'Button'
TRY: Textarea 8 Symbol: Tag Value:
TRY: Textarea 9 Symbol: Top Value: 0
TRY: Textarea 10 Symbol: _new Value: 0 Error: 17 'Button._new' is not a
property
TRY: Textarea 11 Symbol: Copy Value: 0 Error: 11 Unknown symbol 'Copy' in
class 'Button'
TRY: Textarea 12 Symbol: Drag Value: 0 Error: 17 'Button.Drag' is not a
property
TRY: Textarea 13 Symbol: Drop Value:
TRY: Textarea 14 Symbol: Font Value:  Error: 6 Type mismatch: wanted
String, got Font instead
TRY: Textarea 15 Symbol: Grab Value:  Error: 17 'Button.Grab' is not a
property
TRY: Textarea 16 Symbol: Hide Value:  Error: 17 'Button.Hide' is not a
property
TRY: Textarea 17 Symbol: Left Value: 128
TRY: Textarea 18 Symbol: Line Value: 128 Error: 11 Unknown symbol 'Line' in
class 'Button'
TRY: Textarea 19 Symbol: Move Value: 128 Error: 17 'Button.Move' is not a
property
TRY: Textarea 20 Symbol: Name Value: Button5
TRY: Textarea 21 Symbol: Next Value:
TRY: Textarea 22 Symbol: Redo Value:  Error: 11 Unknown symbol 'Redo' in
class 'Button'
TRY: Textarea 23 Symbol: Show Value:  Error: 17 'Button.Show' is not a
property
TRY: Textarea 24 Symbol: Text Value:
TRY: Textarea 25 Symbol: Undo Value:  Error: 11 Unknown symbol 'Undo' in
class 'Button'
TRY: Textarea 26 Symbol: Wrap Value:  Error: 11 Unknown symbol 'Wrap' in
class 'Button'
TRY: Textarea 27 Symbol: :Drag Value:  Error: 17 'Button.:Drag' is not a
property
TRY: Textarea 28 Symbol: :Drop Value:  Error: 17 'Button.:Drop' is not a
property
TRY: Textarea 29 Symbol: :Menu Value:  Error: 17 'Button.:Menu' is not a
property
TRY: Textarea 30 Symbol: Clear Value:  Error: 11 Unknown symbol 'Clear' in
class 'Button'
TRY: Textarea 31 Symbol: Lower Value:  Error: 17 'Button.Lower' is not a
property
TRY: Textarea 32 Symbol: Mouse Value: 0
TRY: Textarea 33 Symbol: Paste Value: 0 Error: 11 Unknown symbol 'Paste' in
class 'Button'
TRY: Textarea 34 Symbol: Proxy Value:
TRY: Textarea 35 Symbol: Raise Value:  Error: 17 'Button.Raise' is not a
property
TRY: Textarea 36 Symbol: ToPos Value:  Error: 11 Unknown symbol 'ToPos' in
class 'Button'
TRY: Textarea 37 Symbol: Width Value: 128
TRY: Textarea 38 Symbol: :Enter Value: 128 Error: 17 'Button.:Enter' is not
a property
TRY: Textarea 39 Symbol: :Leave Value: 128 Error: 17 'Button.:Leave' is not
a property
TRY: Textarea 40 Symbol: Action Value:
TRY: Textarea 41 Symbol: Border Value: T
TRY: Textarea 42 Symbol: Column Value: T Error: 11 Unknown symbol 'Column'
in class 'Button'
TRY: Textarea 43 Symbol: Cursor Value:
TRY: Textarea 44 Symbol: Delete Value:  Error: 17 'Button.Delete' is not a
property
TRY: Textarea 45 Symbol: Design Value:
TRY: Textarea 46 Symbol: Expand Value:
TRY: Textarea 47 Symbol: Handle Value: 60817413
TRY: Textarea 48 Symbol: Height Value: 40
TRY: Textarea 49 Symbol: Ignore Value:
TRY: Textarea 50 Symbol: Insert Value:  Error: 11 Unknown symbol 'Insert'
in class 'Button'
TRY: Textarea 51 Symbol: Length Value:  Error: 11 Unknown symbol 'Length'
in class 'Button'
TRY: Textarea 52 Symbol: Parent Value:  Error: 6 Type mismatch: wanted
String, got Container instead
TRY: Textarea 53 Symbol: Resize Value:  Error: 17 'Button.Resize' is not a
property
TRY: Textarea 54 Symbol: Select Value:  Error: 11 Unknown symbol 'Select'
in class 'Button'
TRY: Textarea 55 Symbol: ToLine Value:  Error: 11 Unknown symbol 'ToLine'
in class 'Button'
TRY: Textarea 56 Symbol: Window Value:  Error: 6 Type mismatch: wanted
String, got Window instead
TRY: Textarea 57 Symbol: :Change Value:  Error: 11 Unknown symbol ':Change'
in class 'Button'
TRY: Textarea 58 Symbol: :Cursor Value:  Error: 11 Unknown symbol ':Cursor'
in class 'Button'
TRY: Textarea 59 Symbol: _Family Value:  Error: 14 'Button._Family' is
static
TRY: Textarea 60 Symbol: _Parent Value:  Error: 6 Type mismatch: wanted
String, got Container instead
TRY: Textarea 61 Symbol: Enabled Value: T
TRY: Textarea 62 Symbol: Hovered Value:
TRY: Textarea 63 Symbol: Refresh Value:  Error: 17 'Button.Refresh' is not
a property
TRY: Textarea 64 Symbol: ScreenX Value: 817
TRY: Textarea 65 Symbol: ScreenY Value: 240
TRY: Textarea 66 Symbol: Tooltip Value:
TRY: Textarea 67 Symbol: Visible Value: T
TRY: Textarea 68 Symbol: :MouseUp Value: T Error: 17 'Button.:MouseUp' is
not a property
TRY: Textarea 69 Symbol: _Similar Value: T Error: 11 Unknown symbol
'_Similar' in class 'Button'
TRY: Textarea 70 Symbol: CursorAt Value: T Error: 11 Unknown symbol
'CursorAt' in class 'Button'
TRY: Textarea 71 Symbol: HasFocus Value:
TRY: Textarea 72 Symbol: Previous Value:  Error: 6 Type mismatch: wanted
String, got Control instead
TRY: Textarea 73 Symbol: ReadOnly Value:  Error: 11 Unknown symbol
'ReadOnly' in class 'Button'
TRY: Textarea 74 Symbol: Reparent Value:  Error: 17 'Button.Reparent' is
not a property
TRY: Textarea 75 Symbol: Selected Value:  Error: 11 Unknown symbol
'Selected' in class 'Button'
TRY: Textarea 76 Symbol: SetFocus Value:  Error: 17 'Button.SetFocus' is
not a property
TRY: Textarea 77 Symbol: ToColumn Value:  Error: 11 Unknown symbol
'ToColumn' in class 'Button'
TRY: Textarea 78 Symbol: Tracking Value:
TRY: Textarea 79 Symbol: Unselect Value:  Error: 11 Unknown symbol
'Unselect' in class 'Button'
TRY: Textarea 80 Symbol: :DblClick Value:  Error: 17 'Button.:DblClick' is
not a property
TRY: Textarea 81 Symbol: :DragMove Value:  Error: 17 'Button.:DragMove' is
not a property
TRY: Textarea 82 Symbol: :GotFocus Value:  Error: 17 'Button.:GotFocus' is
not a property
TRY: Textarea 83 Symbol: :KeyPress Value:  Error: 17 'Button.:KeyPress' is
not a property
TRY: Textarea 84 Symbol: Alignment Value:  Error: 11 Unknown symbol
'Alignment' in class 'Button'
TRY: Textarea 85 Symbol: PopupMenu Value:
TRY: Textarea 86 Symbol: ScrollBar Value:  Error: 11 Unknown symbol
'ScrollBar' in class 'Button'
TRY: Textarea 87 Symbol: SelectAll Value:  Error: 11 Unknown symbol
'SelectAll' in class 'Button'
TRY: Textarea 88 Symbol: Selection Value:  Error: 11 Unknown symbol
'Selection' in class 'Button'
TRY: Textarea 89 Symbol: :DragLeave Value:  Error: 17 'Button.:DragLeave'
is not a property
TRY: Textarea 90 Symbol: :LostFocus Value:  Error: 17 'Button.:LostFocus'
is not a property
TRY: Textarea 91 Symbol: :MouseDown Value:  Error: 17 'Button.:MouseDown'
is not a property
TRY: Textarea 92 Symbol: :MouseDrag Value:  Error: 17 'Button.:MouseDrag'
is not a property
TRY: Textarea 93 Symbol: :MouseMove Value:  Error: 17 'Button.:MouseMove'
is not a property
TRY: Textarea 94 Symbol: _IsControl Value:  Error: 14 'Button._IsControl'
is static
TRY: Textarea 95 Symbol: Background Value: -1
TRY: Textarea 96 Symbol: Foreground Value: -1
TRY: Textarea 97 Symbol: MoveScaled Value: -1 Error: 17 'Button.MoveScaled'
is not a property
TRY: Textarea 98 Symbol: NoTabFocus Value:
TRY: Textarea 99 Symbol: :KeyRelease Value:  Error: 17 'Button.:KeyRelease'
is not a property
TRY: Textarea 100 Symbol: :MouseWheel Value:  Error: 17
'Button.:MouseWheel' is not a property
TRY: Textarea 101 Symbol: _Properties Value:  Error: 14
'Button._Properties' is static
TRY: Textarea 102 Symbol: _DefaultSize Value:  Error: 14
'Button._DefaultSize' is static
TRY: Textarea 103 Symbol: ResizeScaled Value:  Error: 17
'Button.ResizeScaled' is not a property
TRY: Textarea 104 Symbol: _DefaultEvent Value:  Error: 14
'Button._DefaultEvent' is static
TRY: Textarea 105 Symbol: EnsureVisible Value:  Error: 11 Unknown symbol
'EnsureVisible' in class 'Button'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200523/4418f0b3/attachment-0001.html>


More information about the User mailing list