Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2005
    Posts
    103

    Huh? Control and screen focus problems

    I was using this code to check the length of the string, and if it was equal to five, move on to the next box. but it doesn't work. It never moves on. I tried replacing the "==" with a ">", but that jsut gave me an error that said I was trying to compare a number to a nil value.

    I don't know what to do. I put these in the "on Ctrl message" area.

    Code:
    -- These actions are triggered by the controls on the screen.
    --find the length of the first entry
    local srts1L = String.Length("srts1");
    --find the length of the second entry
    local srts2L = String.Length("srts2");
    --find the length of the third entry
    local srts3L = String.Length("srts3");
    --check to see when the first five numbers are entered
    if(strs1L == 5)then
    Screen.SetFocus(CTRL_EDIT_02);
    --check to see when the second set of five numbers are entered
    if(strs2L == 5)then
    Screen.SetFocus(CTRL_EDIT_03);
    --because there are no more places to go, don't need to check for the next set.
    	end
    end

  2. #2
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872
    Hi..have a look at your code..you will see some typo's
    ..your string variables do not match

  3. #3
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    WHEN are these actions executed?

    Have a look at Edit Fields Screen | Example 2 in the help doc:
    "This action script example illustrates how you can validate the contents of an edit field before proceeding in the install. The above script checks to make sure the first two edit fields on the screen are not empty, and prompts the user for input if they are. As you can see, other types of validation can easily be performed using this type of design"

    Darryl's Article: How To Access Screen Input Data is another good place to start.

  4. #4
    Join Date
    Mar 2005
    Posts
    103

    Huh?

    Is there a way to restrice the amount of characters that can be entered in a box? I need to restrict a box to five characters, and when the box reaches five, automatically move on to the next box.

  5. #5
    Join Date
    Jan 2000
    Posts
    2,002
    Try the attached screen. Extract the zip file to your C:\Program Files\Setup Factory 7.0\Screens folder and then add it from the gallery. It should get you started.
    Attached Files

  6. #6
    Join Date
    Mar 2005
    Posts
    103

    Huh?

    Thanks. Those CTRL functions worked great. But now i have another problem:

    I need to take the numbers from the three fields and combine them into one number for checking. I have tried making a table out of the strings, then using Table.Concat. Then I tried just leaving them as strings and using String.Concat.... but nothing seems to work. I always get a "Invalid Serial Number" error.....and I am getting angry/desperate....aaahhhh.....


    Here is an example of the table:
    Code:
    -- These actions are performed when the Next button is clicked.
    
    -- get the serial number that the user entered
    --get the first part
    local strs1 = SessionVar.Expand("%sp1%");
    --get the second part
    local strs2 = SessionVar.Expand("%sp2%");
    --get the third part
    local strs3 = SessionVar.Expand("%sp3%");
    serial_table = {}
    --add the values
     Table.Insert(serial_table, 1, strs1);
     Table.Insert(serial_table, 2, strs2);
     Table.Insert(serial_table, 3, strs3);
    --combine the contents of the table into the string
    strSerial = Table.Concat(serial_table, "", 1, TABLE_ALL);

    Here is an example of the string:
    Code:
    -- get the serial number that the user entered
    --get the first part
    local strs1 = SessionVar.Expand("%sp1%");
    --get the second part
    local strs2 = SessionVar.Expand("%sp2%");
    --get the third part
    local strs3 = SessionVar.Expand("%sp3%");
    --Combine the first two strings
    strsp1 = String.Concat("strs3", "strs2");
    --combine the first two with the third string
    strSerial = String.Concat("strsp1", "strs1");
    Last edited by rctshine; 03-24-2005 at 02:26 PM.

  7. #7
    Join Date
    Jan 2000
    Posts
    2,002
    Try:

    Code:
    -- get the serial number that the user entered
    --get the first part
    local strs1 = SessionVar.Expand("%sp1%");
    --get the second part
    local strs2 = SessionVar.Expand("%sp2%");
    --get the third part
    local strs3 = SessionVar.Expand("%sp3%");
    
    strPassword = strs1..strs2..strs3;
    or if you want dashes (or whatever):

    Code:
    strPassword = strs1.."-"..strs2.."-"..strs3;

  8. #8
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    Quote Originally Posted by rctshine
    Is there a way to restrice the amount of characters that can be entered in a box? I need to restrict a box to five characters, and when the box reaches five, automatically move on to the next box.
    The answer is YES, as already demonstrated by Brett with his "Multi Field Serial Number" screen!

    rctshine's question inspired me to investigate the possibilities. The event variables e_CtrlID, e_MsgID and e_Details belong to the "heavy stuff" in SU70; at least that is my opinion. I had success; it really is possible "to manage and manipulate this screen at run time" (quote help doc).

    Suggestion for the help doc:
    Cross reference link between Controls (Controls Types) and Screen Types.

    What are the possible notification message ids when working with the Edit Field screen? The answer is MSGID_ONCHANGED. The list box screen has MSGID_CLICKED and MSGID_ONSELCHANGED. A link from Screen Type (the context sensitive help page) to the corresponding control type page should be helpful.

    Q#1: I encountered one problem; I had an edit field with the optional button with this code:
    Code:
    if (e_CtrlID == CTRL_EDIT_01) then
    	SessionVar.Set("%B_EditVar01%","Edit Fields Control.txt");
    	DlgEditField.SetProperties(CTRL_EDIT_01, {Text = "Edit Fields Control.txt"});
    	Screen.SetFocus(CTRL_BUTTON_01);
    end
    The Set Focus command wasn't "good". Focus OK, but the button text disappeares until the cursor is moved over the button. I tried another theme, but the behaviour was identical.

    Q#2: The Style Pane, what object is controlled by "Controls Disable Text" (colour)?
    I couldn't notice any difference anywhere?

  9. #9
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    I found the answer to my first question:

    The MSGID_ONCHANGED event is triggered several times when the screen is created (before On Preload). By introducing a Boolean variable (bDisplayCtrMsg) set at the end of 'On Preload', I could temporarily disable the MSGID_ONCHANGED event:

    Code:
    if (e_MsgID == MSGID_ONCHANGED) and (bDisplayCtrMsg) then 
    	if (e_CtrlID == CTRL_EDIT_01) then
    
    		bDisplayCtrMsg = false;	-- disable the MSGID_ONCHANGED event
    		SessionVar.Set("%B_EditVar01%","Edit Fields Control.txt");
    		DlgEditField.SetProperties(CTRL_EDIT_01, {Text = "Edit Fields Control.txt"});
    		bDisplayCtrMsg = true;	-- ensable the MSGID_ONCHANGED event
    		
    		Screen.SetFocus(CTRL_BUTTON_01);	
    	end
    end
    With this code the button display is NOT changed.

    Still I wonder about Q#2. Can anybody tell me?

Similar Threads

  1. Is there any way to control video when set to full screen?
    By Scampula in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 12-02-2003, 08:31 AM
  2. INFO: Troubleshooting ActiveX Control Installation
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-03-2002, 10:19 AM
  3. HOWTO: Install a Screen Saver
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-27-2002, 01:35 PM
  4. SUF-6 "Performing Setup Actions" screen
    By garhop in forum Setup Factory 6.0
    Replies: 6
    Last Post: 02-05-2002, 08:24 AM
  5. Pregress Screen control - SF6
    By tuhkanen in forum Setup Factory 6.0
    Replies: 1
    Last Post: 01-15-2002, 09:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts