LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String control on sub-VI

I have a sub-VI that pops up and gets one line of user input in a string
control and then closes. I don't want the user to have to click the
string control to get the cursor to appear so that he/she can start
typing. Is there a way to get the cursor to pop up ready to type when
the VI is called?

thanks,
stephen
0 Kudos
Message 1 of 11
(4,198 Views)
Create a property node for the string control. wire keyfocus true. To make
the current string in the control all selected (so typing will replace what
is there from the last use) add another element to the property node and
select text.selection all elements. Create a cluster (right click and select
create constant) and make the first value 0 and the last some number that
is greater than the user can input (say 100). When the input box is called,
the string control will have focus and all the text from the last use will
be highlighted. Typing will cause the old text to disapppear and the new
text will replace it.

Jared

Stephen Gray wrote:
>I have a sub-VI that pops up and gets one line of user input in a string>control
and then closes. I don'
t want the user to have to click the>string control
to get the cursor to appear so that he/she can start>typing. Is there a
way to get the cursor to pop up ready to type when>the VI is called?>>thanks,>stephen
0 Kudos
Message 2 of 11
(4,198 Views)
Hi Stephen

You can do this by using an "Enumerated Type" control (List and Ring
pallete) on the subvi's front panel (and assigned on the connector pane).
It is much like a ring control, but it has a couple of handy features.
Check out the Labview help reference on "Enumerated Type Control", which is

what I did, because it explains it all.

Paul

Stephen Gray wrote:

> I have a sub-VI that pops up and gets one line of user input in a string
> control and then closes. I don't want the user to have to click the
> string control to get the cursor to appear so that he/she can start
> typing. Is there a way to get the cursor to pop up ready to type when
> the VI is called?
>
> thanks,
> stephen

--

Research Assistant
School of Physiotherapy, Curtin University of Techno
logy
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: P.C.Davey@curtin.edu.au
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699

"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all have sinned and fall short of the glory of God, and are justified
freely by his grace through the redemption that came by Christ Jesus."
Romans 3:23-4
0 Kudos
Message 3 of 11
(4,198 Views)
Hi Stephen

Sorry about the previous post to your question - I replied to the wrong
post. So I'd better try to answer this question too.

You can create an attribute node for the string control on the subvi that
has a True boolean constant wired to the item "Key Focus", and this should
do the trick. You would want this to be the first bit of your code to run
in the subvi so it is ready for the user input.

Paul

Stephen Gray wrote:

> I have a sub-VI that pops up and gets one line of user input in a string
> control and then closes. I don't want the user to have to click the
> string control to get the cursor to appear so that he/she can start
> typing. Is there a way to get the cursor to pop up ready to type when
> the VI is called?
>
> thanks,
> stephen

--

R
esearch Assistant
School of Physiotherapy, Curtin University of Technology
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: P.C.Davey@curtin.edu.au
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699

"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all have sinned and fall short of the glory of God, and are justified
freely by his grace through the redemption that came by Christ Jesus."
Romans 3:23-4
0 Kudos
Message 4 of 11
(4,198 Views)
Hi Paul,

i had the same problem to focus the control. But when i used this way i
get an ugly black box around the string control. Is there a way to avoid
it?

Henrik
0 Kudos
Message 5 of 11
(4,198 Views)
Hi Henrik

I have no idea. I suppose the black box is a bit ugly, but it does give
the user some clue as to which control is the active control. In
VB/Windows programs you get the same kind of border, which is useful if
they are tabbing around.

Perhaps you could carefully position some rectangular decorations around
the string control to block out the black border (which appears around the
outside of the control) - it seems to work if you colour the borders of the
decorations transparent and bring them in front of the control.

Paul

Henrik Skupin wrote:

> Hi Paul,
>
> i had the same problem to focus the control. But when i used this way i
> get an ugly black box around the string control. Is there a way to avoid
> it?
>
> Henrik

--

Research Ass
istant
School of Physiotherapy, Curtin University of Technology
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: P.C.Davey@curtin.edu.au
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699

"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all have sinned and fall short of the glory of God, and are justified
freely by his grace through the redemption that came by Christ Jesus."
Romans 3:23-4
0 Kudos
Message 7 of 11
(4,198 Views)
I think the easiest way to get around the "ugly black box" is to put a string
control off screen, give it focus, right click and select "update value while
typing". Then, wire this control into a string indicator the user can see.
As the user types, the indicator on screen gets updated and no box appears
around it.

Jared

Paul Davey wrote:
>Hi Henrik>>I have no idea. I suppose the black box is a bit ugly, but it
does give>the user some clue as to which control is the active control.
In>VB/Windows programs you get the same kind of border, which is useful if>they
are tabbing around.>>Perhaps you could carefully position some rectangular
decorations around>the string control to block out the black border (which

appears around the>outside of the control) - it seems to work if you colour
the borders of the>decorations transparent and bring them in front of the
control.>>Paul>>Henrik Skupin wrote:>>> Hi Paul,>>>> i had the same problem
to focus the control. But when i used this way i>> get an ugly black box
around the string control. Is there a way to avoid>> it?>>>> Henrik>>-->>Research
Assistant>School of Physiotherapy, Curtin University of Technology>Selby
Street, Shenton Park, Western Australia, Australia. 6008>email: P.C.Davey@curtin.edu.au>Tel.
+61 8 9266 4657 Fax. +61 8 9266 3699>>"Everyone who calls on the name
of the Lord will be saved." Romans 10:12>"For all have sinned and fall short
of the glory of God, and are justified>freely by his grace through the redemption
that came by Christ Jesus.">Romans 3:23-4>>
0 Kudos
Message 8 of 11
(4,198 Views)
Hi,

You can place a "Flat Frame" around it, in the same colour as the
background. Not very elegant, but effective!

Regards,

Wiebe Walstra.

AIR technical Automation
www.air.nl


"Paul Davey" wrote in message
news:3A776A1F.E701F898@cc.curtin.edu.au...
Hi Henrik

I have no idea. I suppose the black box is a bit ugly, but it does give
the user some clue as to which control is the active control. In
VB/Windows programs you get the same kind of border, which is useful if
they are tabbing around.

Perhaps you could carefully position some rectangular decorations around
the string control to block out the black border (which appears around the
outside of the control) - it seems to work if you colour the borders
of the
decorations transparent and bring them in front of the control.

Paul

Henrik Skupin wrote:

> Hi Paul,
>
> i had the same problem to focus the control. But when i used this way i
> get an ugly black box around the string control. Is there a way to avoid
> it?
>
> Henrik

--

Research Assistant
School of Physiotherapy, Curtin University of Technology
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: P.C.Davey@curtin.edu.au
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699

"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all have sinned and fall short of the glory of God, and are justified
freely by his grace through the redemption that came by Christ Jesus."
Romans 3:23-4
0 Kudos
Message 9 of 11
(4,198 Views)
On Tue, 30 Jan 2001 08:56:20 +0100, Henrik Skupin
wrote:

>Hi Paul,
>
>i had the same problem to focus the control. But when i used this way i
>get an ugly black box around the string control. Is there a way to avoid
>it?

Please don't remove it (my opinion). This black box shows where the
focus is. If you have several buttons and controls on a front panel
then you need this to know which button and text field you are
operating, especially if you don't use the mouse to navigate.

(Yes, i know that if you have only one control on the front panel then
it shouldn't matter and the text box (or number box) has a marker in
it).

--
rolf
0 Kudos
Message 10 of 11
(4,198 Views)
Paul Davey wrote:
>Hi Stephen>>Sorry about the previous post to your question - I replied to
the wrong>post. So I'd better try to answer this question too.>>You can
create an attribute node for the string control on the subvi that>has a True
boolean constant wired to the item "Key Focus", and this should>do the trick.
You would want this to be the first bit of your code to run>in the subvi
so it is ready for the user input.>>Paul>>Stephen Gray wrote:>>> I have a
sub-VI that pops up and gets one line of user input in a string>> control
and then closes. I don't want the user to have to click the>> string control
to get the cursor to appear so that he/she can start>> typing. Is there
a way to get the cursor to pop up ready to
type when>> the VI is called?>>>>
thanks,>> stephen>>-->>Research Assistant>School of Physiotherapy, Curtin
University of Technology>Selby Street, Shenton Park, Western Australia, Australia.
6008>email: P.C.Davey@curtin.edu.au>Tel. +61 8 9266 4657 Fax. +61 8 9266
3699>>"Everyone who calls on the name of the Lord will be saved." Romans
10:12>"For all have sinned and fall short of the glory of God, and are justified>freely
by his grace through the redemption that came by Christ Jesus.">Romans 3:23-4>>

paul,

first select the decoration. there is a drop down menu (it has 2 circular
arrows on the button) near the fonts menu that has a list of choices, such
as move to the back.
0 Kudos
Message 6 of 11
(4,198 Views)