Your Products have been synced, click here to refresh
Begin Dialog DLGGENFEAT -1,46, 260, 242, "Construct Generic Feature",[B] .Events[/B] Text 4,4,61,12, "Feature name:" TextBox 68,4,112,12, .edFeatName OptionGroup .GRPFEATURE OptionButton 8,40,37,12, "Point" OptionButton 8,56,37,12, "Plane" . . . End Dialog
Function Events(ControlID$, Action%, SuppValue%) Events = 99 ' Don't Close Dialog, just continue ' Select Case Action% ' Case 1 ' Before Dialog is visible, hide some controls ("Point" assumed) ' DlgEnable "lbOutIn", 0 DlgVisible "lbOutIn", 0 DlgEnable "edAngle", 0 DlgEnable "edDistance", 0 DlgEnable "edRadDiam", 0 DlgEnable "edBoth", 0 DlgEnable "edValueRef", 0 ' Case 2 ' Button pushed, checkbox checked, etc. ControlID$, SuppValue% ' ' For some reason, the radio buttons 'Name' starts With a quote character!? If Left(ControlID$, 1) = chr(34) Then ' Radio button, but which one? There's no way To Get the group Name, so we have To check the actual text If we have more than one ' group, And we can't actually differentiate If two groups have the same text somewhere :-( ' ' Solution: Eliminate all radio groups but one, making combo boxes of the others - done! ' ' activate/deactivate appropriate fields, depending On which radio button was clicked ' FeatureType = SuppValue% Select Case FeatureType ' Case 0, 1 ' Point, Plane DlgVisible "lbOutIn", 0 DlgEnable "lbOutIn", 0 DlgEnable "edAngle", 0 DlgEnable "edDistance", 0 DlgEnable "edRadDiam", 0 ' Case 2 ' Line DlgVisible "lbOutIn", 0 DlgEnable "lbOutIn", 0 DlgEnable "edAngle", 0 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 0 ' Case 3 ' None DlgVisible "lbOutIn", 0 DlgEnable "lbOutIn", 0 DlgEnable "edAngle", 1 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 1 ' Case 4, 5 ' Circle, Sphere DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 0 DlgEnable "edDistance", 0 DlgEnable "edRadDiam", 1 ' Case 6 ' Cylinder DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 0 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 1 ' Case 7, 8 ' Round slot, Square slot DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 0 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 1 ' Case 9 ' Cone DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 1 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 0 ' End Select ' Elseif Left(ControlID$, 2) = "lb" Then ' If ControlID$ = "lbSelFeatCoord" Then ' Copy the selected feature name to the edit boxes ' ' feature coordinate selection list ' SelFeatCoordID = FeatureList(SuppValue% + 1) DlgText "edX", SelFeatCoordID + ".X" DlgText "edY", SelFeatCoordID + ".Y" DlgText "edZ", SelFeatCoordID + ".Z" ' ' Use the same feature for IJK, for now... ' SelFeatVectID = SelFeatCoordID DlgText "edI", SelFeatVectID + ".I" DlgText "edJ", SelFeatVectID + ".J" DlgText "edK", SelFeatVectID + ".K" ' ElseIf ControlID$ = "lbSelFeatVect" Then ' ...unless someone clicked the other selection list ' ' feature vector selection list ' SelFeatVectID = FeatureList(SuppValue% + 1) DlgValue "lbValueRef", 2 DlgText "edI", SelFeatVectID + ".I" DlgText "edJ", SelFeatVectID + ".J" DlgText "edK", SelFeatVectID + ".K" ' Else ' ' other listboxes And comboboxes, Nothing To Do now - values may be Read later when generating ' End If ' Else ' buttons ' ' Note: ControlID$ is wrong For buttons!!! And we need To check edFeatName If OK pressed ' If ControlID$ = "Cancel" Then ' Yes, this is the OK button !!! If DlgText("edFeatName") <> "" Then Events = 0 ' OK To leave Else MsgBox "You must enter a name for the feature!" End If Else Events = 0 ' Leave Dialog, End If ' End If ' Case 3 ' Change detected (Help doesn't seem To be correct here - gets called directly when a character changes In an Edit box) If Left(ControlID$, 2) = "ed" Then ' Nothing To Do Else ' Nothing To Do - don't even know what events would Get here... End If ' Case 4 ' Focus change, ControlID$ tells which control will Get focused, SuppValue% numid of control losing it. No MsdgBox Or Dlg here! ' don't know what use it can have... FocusedControl = ControlID$ LastFocus = SuppValue% ' DlgText "edFeatName", ControlID$+", "+ Str$(SuppValue%) ' debug End Select ' End Function
Begin Dialog DLGGENFEAT -1,46, 260, 242, "Construct Generic Feature",[B] .Events[/B] Text 4,4,61,12, "Feature name:" TextBox 68,4,112,12, .edFeatName OptionGroup .GRPFEATURE OptionButton 8,40,37,12, "Point" OptionButton 8,56,37,12, "Plane" . . . End Dialog
Function Events(ControlID$, Action%, SuppValue%) Events = 99 ' Don't Close Dialog, just continue ' Select Case Action% ' Case 1 ' Before Dialog is visible, hide some controls ("Point" assumed) ' DlgEnable "lbOutIn", 0 DlgVisible "lbOutIn", 0 DlgEnable "edAngle", 0 DlgEnable "edDistance", 0 DlgEnable "edRadDiam", 0 DlgEnable "edBoth", 0 DlgEnable "edValueRef", 0 ' Case 2 ' Button pushed, checkbox checked, etc. ControlID$, SuppValue% ' ' For some reason, the radio buttons 'Name' starts With a quote character!? If Left(ControlID$, 1) = chr(34) Then ' Radio button, but which one? There's no way To Get the group Name, so we have To check the actual text If we have more than one ' group, And we can't actually differentiate If two groups have the same text somewhere :-( ' ' Solution: Eliminate all radio groups but one, making combo boxes of the others - done! ' ' activate/deactivate appropriate fields, depending On which radio button was clicked ' FeatureType = SuppValue% Select Case FeatureType ' Case 0, 1 ' Point, Plane DlgVisible "lbOutIn", 0 DlgEnable "lbOutIn", 0 DlgEnable "edAngle", 0 DlgEnable "edDistance", 0 DlgEnable "edRadDiam", 0 ' Case 2 ' Line DlgVisible "lbOutIn", 0 DlgEnable "lbOutIn", 0 DlgEnable "edAngle", 0 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 0 ' Case 3 ' None DlgVisible "lbOutIn", 0 DlgEnable "lbOutIn", 0 DlgEnable "edAngle", 1 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 1 ' Case 4, 5 ' Circle, Sphere DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 0 DlgEnable "edDistance", 0 DlgEnable "edRadDiam", 1 ' Case 6 ' Cylinder DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 0 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 1 ' Case 7, 8 ' Round slot, Square slot DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 0 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 1 ' Case 9 ' Cone DlgVisible "lbOutIn", 1 DlgEnable "lbOutIn", 1 DlgEnable "edAngle", 1 DlgEnable "edDistance", 1 DlgEnable "edRadDiam", 0 ' End Select ' Elseif Left(ControlID$, 2) = "lb" Then ' If ControlID$ = "lbSelFeatCoord" Then ' Copy the selected feature name to the edit boxes ' ' feature coordinate selection list ' SelFeatCoordID = FeatureList(SuppValue% + 1) DlgText "edX", SelFeatCoordID + ".X" DlgText "edY", SelFeatCoordID + ".Y" DlgText "edZ", SelFeatCoordID + ".Z" ' ' Use the same feature for IJK, for now... ' SelFeatVectID = SelFeatCoordID DlgText "edI", SelFeatVectID + ".I" DlgText "edJ", SelFeatVectID + ".J" DlgText "edK", SelFeatVectID + ".K" ' ElseIf ControlID$ = "lbSelFeatVect" Then ' ...unless someone clicked the other selection list ' ' feature vector selection list ' SelFeatVectID = FeatureList(SuppValue% + 1) DlgValue "lbValueRef", 2 DlgText "edI", SelFeatVectID + ".I" DlgText "edJ", SelFeatVectID + ".J" DlgText "edK", SelFeatVectID + ".K" ' Else ' ' other listboxes And comboboxes, Nothing To Do now - values may be Read later when generating ' End If ' Else ' buttons ' ' Note: ControlID$ is wrong For buttons!!! And we need To check edFeatName If OK pressed ' If ControlID$ = "Cancel" Then ' Yes, this is the OK button !!! If DlgText("edFeatName") <> "" Then Events = 0 ' OK To leave Else MsgBox "You must enter a name for the feature!" End If Else Events = 0 ' Leave Dialog, End If ' End If ' Case 3 ' Change detected (Help doesn't seem To be correct here - gets called directly when a character changes In an Edit box) If Left(ControlID$, 2) = "ed" Then ' Nothing To Do Else ' Nothing To Do - don't even know what events would Get here... End If ' Case 4 ' Focus change, ControlID$ tells which control will Get focused, SuppValue% numid of control losing it. No MsdgBox Or Dlg here! ' don't know what use it can have... FocusedControl = ControlID$ LastFocus = SuppValue% ' DlgText "edFeatName", ControlID$+", "+ Str$(SuppValue%) ' debug End Select ' End Function
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |