SegmentedControl

  1. 6 years ago

    Joel_Eisenstat

    5 Jun 2017 User since 2016

    Hi,
    There seems to be problem with Segmented Control in that if there are multiple segments controls within the same window
    Creo seems confused and the segment titles are passed in-between. For example if one has segments named 1 and 2 while another has 3,4 and 5 , after manipulation of the window ( sorry to be so vague but I have not figured out why) 1 and 2 may change to 3 and 4. My feeling it has something to do with copy and paste. Initially I thought it was my doing but it now being seen consistently, even after renaming.
    Regards,
    Joel

  2. marco

    6 Jun 2017 Administrator User since 2016

    Hi @Joel_Eisenstat do you know how to reproduce the issue?

  3. Joel_Eisenstat

    6 Jun 2017 User since 2016

    It is difficult to reproduce as it is observed during the course of manipulations within the window. A debugger with trace / step capabilities would be a help here.
    However I can reproduce the need to " double tap" the segmented control when it is used to switch between windows. I tried to get around this by adding SegmentedControl.setSegmentEnabled(enabled: Bool, segmentIndex: Int) but this didn't seem to work.

  4. Joel_Eisenstat

    6 Jun 2017 User since 2016

    Other issues I am noticing is the title of segment 1 changing to the title of segment 4 while going from 1 to 4.

  5. andrea

    7 Jun 2017 Administrator User since 2016

    Hi @Joel_Eisenstat , I've have fixed the issue with the titles of a segmented control getting the values of another control after a selection change, we will release an updated version in the next few days.

    For the other question about the "double tap":
    I tried to reproduce your app by creating with two windows, each one with a segmented control and using the segmented control's "Changed" action to open the other window. If I understand correctly your situation, I'm able to realize what you need by changing the segmented control's index of the control in the opening window with the following code (in the "Changed" event of the segmented control of the first window, and similar code in the event of the control of the second window):

    if (index == 1) { 
    	Window2.open();
    	Window2.SegmentedControl1.index = 1;
    }

    It also works if you change the index of the selected control in the "WillShow" or "DidShow" event of the window.

    I've attached the sample project used for this test, please let me know if this is useful to you.

  6. Joel_Eisenstat

    7 Jun 2017 User since 2016

    Hi Andrea,
    Thanks for taking care of that .
    Regards,
    Joel

  7. Joel_Eisenstat

    7 Jun 2017 User since 2016

    Sample project
    Runtime Error
    Unable to find index into class _SegmentedControl1
    ;( Possibly version 5670

  8. Joel_Eisenstat

    8 Jun 2017 User since 2016

    Got it; to control movement with the segmented control and have the right segment displayed
    copy and paste into each window
    if (index == 0) {
    Detail.open();
    Detail.SegmentedControl1.selectedSegmentIndex = 0;
    } else if ( index == 1) {
    Window1.open();
    Window1.SegmentedControl1.selectedSegmentIndex = 1;
    } else if ( index == 2) {
    Window2.open();
    Window2.SegmentedControl1.selectedSegmentIndex = 2;
    } else {
    Window4.open();
    Window4.SegmentedControl1.selectedSegmentIndex = 4;
    }

  9. marco

    8 Jun 2017 Administrator User since 2016

    Hi @Joel_Eisenstat I confirm you that in the latest 1.0b8 version selectedSegmentIndex property has been renamed to index.

  10. Joel_Eisenstat

    9 Jun 2017 User since 2016

    Good morning,
    The Segmented Control may still have an issue in b8 .
    Runtime Error
    Unable to find open into class Float ;

    if (index == 0 ) {
    Detail.open();
    Detail.SegmentedControl1.index = 0;
    } else if (index == 1 ) {
    Window1.open();
    Window1.SegmentedControl1.index = 1;
    } else if (index == 2 ) {
    Window2.open();
    Window2.SegmentedControl1.index = 2;
    } else {
    Window.3.open();
    Window3.SegmentedControl1.index = 3;
    }

  11. Joel_Eisenstat

    9 Jun 2017 User since 2016

    Also the new CreoPlayer still requires a "double tap" to change segments .

  12. marco

    9 Jun 2017 Administrator User since 2016

    @Joel_Eisenstat do you have a project to share with me?

  13. Joel_Eisenstat

    9 Jun 2017 User since 2016

    Error on Win 3 segment

  14. marco

    10 Jun 2017 Administrator User since 2016

    @Joel_Eisenstat there is a syntax error in your code, in the Changed event you wrote:

    Window.3.open();

    instead of

    Window3.open();

    (notice the dot after Window in the first version)

  15. Joel_Eisenstat

    10 Jun 2017 User since 2016

    Thanks Marco, I apologize for jumping the gun on that.

or Sign Up to reply!