Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Visual DCL Programming
»
OpenDCL
»
Topic:
dcl-TextBox-SetSel looks like it doesn't work
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: dcl-TextBox-SetSel looks like it doesn't work (Read 4225 times)
0 Members and 1 Guest are viewing this topic.
domenicomaria
Swamp Rat
Posts: 725
dcl-TextBox-SetSel looks like it doesn't work
«
on:
June 10, 2022, 04:14:54 AM »
(dcl-TextBox-SetSel dgs-prj dgs-frm "textbox" 0 -1)
dcl-TextBox-SetSel
looks like it
doesn't work
...
doesn't select text
doesn't select anything !
is there anyone who has experienced the same problem ?
Logged
owenwengerd
Bull Frog
Posts: 451
WWW
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #1 on:
June 10, 2022, 12:33:06 PM »
The string "textbox" is invalid. Perhaps you intended this:
Code - Auto/Visual Lisp:
[Select]
(
dcl
-
Control
-
SetText dgs
-
prj
"textbox"
)
(
dcl
-
TextBox
-
SetSel dgs
-
prj dgs
-
frm
0
-
1
)
Logged
Owen Wengerd @
Outside The Box
/
ManuSoft
/
CADLock, Inc.
domenicomaria
Swamp Rat
Posts: 725
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #2 on:
June 10, 2022, 01:42:20 PM »
dgs-prj
is the variabile that contains the name of the odcl
project
while
dgs-frm
is the variabile that contains the name of the
form
and
"textbox"
is the name of the
textbox control
«
Last Edit: June 10, 2022, 01:56:56 PM by domenicomaria
»
Logged
owenwengerd
Bull Frog
Posts: 451
WWW
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #3 on:
June 10, 2022, 05:25:42 PM »
Ah, I see, you use strings instead of symbols to refer to the control. In that case, maybe the failure is related to the context in which the function is called. Does it work in a button clicked event?
Logged
Owen Wengerd @
Outside The Box
/
ManuSoft
/
CADLock, Inc.
domenicomaria
Swamp Rat
Posts: 725
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #4 on:
June 11, 2022, 01:47:32 AM »
It is called at ON-INITIALIZE event
Logged
domenicomaria
Swamp Rat
Posts: 725
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #5 on:
June 11, 2022, 02:15:30 AM »
Code - Auto/Visual Lisp:
[Select]
(
defun
:DCL
-
GETSTRING
(
title description default left
-
top
-
lst
/
%
dgs
-
frm
%
dgs
-
prj default description r
-
string title
)
(
defun
c:DCL
-
GETSTRING
-
ONINITIALIZE
(
/
)
(
dcl
-
control
-
setcaption
%
dgs
-
prj
%
dgs
-
frm
"title"
title
)
(
dcl
-
control
-
setcaption
%
dgs
-
prj
%
dgs
-
frm
"description"
description
)
(
dcl
-
control
-
settext
%
dgs
-
prj
%
dgs
-
frm
"textbox"
default
)
(
dcl
-
TextBox
-
SetSel
%
dgs
-
prj
%
dgs
-
frm
"textbox"
0
-
1
)
(
dcl
-
Control
-
SetFocus
%
dgs
-
prj
%
dgs
-
frm
"textbox"
)
)
(
defun
C:DGS
-
OK
(
/
)
(
setq
r
-
string
(
dcl
-
control
-
gettext
%
dgs
-
prj
%
dgs
-
frm
"textbox"
)
)
(
dcl
-
form
-
close
%
dgs
-
prj
%
dgs
-
frm
)
)
(
defun
C:DGS
-
ONRETURNPRESSED
(
/
)
(
setq
r
-
string
(
dcl
-
control
-
gettext
%
dgs
-
prj
%
dgs
-
frm
"textbox"
)
)
(
dcl
-
form
-
close
%
dgs
-
prj
%
dgs
-
frm
)
)
(
defun
C:DGS
-
CANCEL
(
/
)
(
setq
r
-
string
nil
)
(
dcl
-
form
-
close
%
dgs
-
prj
%
dgs
-
frm
)
)
(
setq
%
dgs
-
prj
"dcl-getstring"
%
dgs
-
frm
"dcl-getstring-frm"
)
(
dcl
-
loadproject
%
dgs
-
prj t
)
(
cond
(
(
and
left
-
top
-
lst
(
listp
left
-
top
-
lst
)
)
(
dcl
-
form
-
show
%
dgs
-
prj
%
dgs
-
frm
(
car
left
-
top
-
lst
)
(
cadr
left
-
top
-
lst
)
)
)
(
(
=
left
-
top
-
lst T
)
(
setq
left
-
top
-
lst
(
dcl
-
getmousecoords
)
)
(
dcl
-
form
-
show
%
dgs
-
prj
%
dgs
-
frm
(
car
left
-
top
-
lst
)
(
cadr
left
-
top
-
lst
)
)
)
(
T
(
dcl
-
form
-
show
%
dgs
-
prj
%
dgs
-
frm
)
)
)
r
-
string
)
(
defun
c:k
(
)
(
setq
mc
(
dcl
-
getmousecoords
)
left
(
nth
0
mc
)
top
(
nth
1
mc
)
r
(
:DCL
-
GETSTRING
"... NEW SUB-MENU NAME ..."
" enter the new sub menu name, below :"
"[ M E N U 0 1 ]"
(
list
left top
)
)
)
r
)
«
Last Edit: June 11, 2022, 02:19:40 AM by domenicomaria
»
Logged
domenicomaria
Swamp Rat
Posts: 725
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #6 on:
June 11, 2022, 10:26:03 AM »
It depends from the
control tab order
...
if I put the textbox control
in the
first position
,
everything works well !
Logged
owenwengerd
Bull Frog
Posts: 451
WWW
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #7 on:
June 11, 2022, 10:32:36 AM »
I see you discovered a solution while I was composing a reply. Posting anyway in case it is useful in the future.
-- snip --
I suppose your call happens too early, and either gets undone by following initialization by the form itself, or the control just doesn't process selection methods before it is visible. You might try delaying the call by setting a timer and doing it from the timer event; or make this the first control in the form's tab order so the dialog does the work for you when it sets initial focus to the textbox.
Logged
Owen Wengerd @
Outside The Box
/
ManuSoft
/
CADLock, Inc.
domenicomaria
Swamp Rat
Posts: 725
Re: dcl-TextBox-SetSel looks like it doesn't work
«
Reply #8 on:
June 11, 2022, 10:43:09 AM »
"
or make this the first control in the form's tab order"
I think this is the simplest thing ...
thanks for your attention, Owen ...
Ciao
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Visual DCL Programming
»
OpenDCL
»
Topic:
dcl-TextBox-SetSel looks like it doesn't work