Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 04:43:52 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
Dialog box - which button pressed
Pages:
1
Go Down
« previous
next »
Author
Topic: Dialog box - which button pressed (Read 489 times)
0 Members and 1 Guest are viewing this topic.
tmead
Active Member
Offline
Posts: 61
Dialog box - which button pressed
«
on:
February 25, 2011, 12:11:14 PM »
I'm struggling a bit to try to get some code to update a userlabel. Seems there are a few ways of doing this. So far I've found:
Method 1
Qty = GetUserLabel(61)
Qty = Question("Enter Quantity of Line " & ThisPriority)
SetUserLabel(61,Qty)
But there is no way to pick up the current value of the label to use as a default - means the user has to type new every time
Method 2
Begin Dialog TextBoxSample 16,30,180,96,"Enter Required Quantity"
OKButton 132,20,40,14
CancelButton 132,44,40,14
Text 8,8,32,8,"Text Box:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample
Button = Dialog ( Dlg1 )
SetUserLabel ( 61,Dlg1.TextBox1 )
Same problem - I can't figure a way to show the current value, and the user has to click into the field before entering data
Method 3
Default = GetUserlabel(61)
Answer = InputBox$("Enter data", "Title", Default, 200, 200)
SetUserLabel(61,Answer)
Now this one I like - but i can't crack the last bit - how to not update anything when cancel is pressed ! At the moment the contents of the label are wiped if cancel is pressed, and I'd liek them to be left alone !
The Cypress Enable manual is full of detail about how to construct dialogs, but there is a level of assumed knowledge about what to do with the output that I simply don't have !
Tim
Logged
tmead
Active Member
Offline
Posts: 61
Re: VB Script Dialog box - determine which button pressed
«
Reply #1 on:
February 27, 2011, 04:47:35 AM »
Blatant bump for the post !
Does anyone know how to determine which button was pressed in a dialog box ?
Tim
Logged
ger21
Global Moderator
Online
Posts: 2,619
Re: Dialog box - which button pressed
«
Reply #2 on:
February 27, 2011, 08:35:39 AM »
Nt sure why the first one doesn't work, but what about this?
Default = GetUserlabel(61)
Answer = InputBox$("Enter data", "Title", Default, 200, 200)
If Answer <> "" then SetUserLabel(61,Answer)
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
tmead
Active Member
Offline
Posts: 61
Re: Dialog box - which button pressed
«
Reply #3 on:
February 27, 2011, 05:43:21 PM »
Thanks for that, I've just got to a similar result by discriminating between entered data and cancel by using len(answer)>0.
I can't helpfeeling there must be a way of checking which button was pressed, which may be more elegant. However, these ways work !
Help much appreciated.
Tim
Logged
stirling
Global Moderator
Offline
Posts: 1,190
UK
Re: Dialog box - which button pressed
«
Reply #4 on:
February 28, 2011, 04:33:08 AM »
Tim
Code:
Begin Dialog TextBoxSample 16,30,180,96,"Enter Required Quantity"
OKButton 132,20,40,14
CancelButton 132,44,40,14
Text 8,8,32,8,"Text Box:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample
Dlg1.TextBox1="Hello world" 'default value
Button = Dialog ( Dlg1 ) '-1 = ok, 0 = cancel
Ian
Logged
tmead
Active Member
Offline
Posts: 61
Re: Dialog box - which button pressed
«
Reply #5 on:
February 28, 2011, 05:10:40 AM »
Ahh... thanks for that, I'd had a play with something similar, but did not get the syntax right.
I'm still in favour of the inputbox method, as I cannot get the DlgFocus command to allow direct entry into the box without having to click into it. The inputbox command does it for me !
Tim
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...