From d39e4124823623c8142aab97a7e093683fb83ef4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 12 Dec 1991 17:39:09 +0000 Subject: [PATCH] Now automatically test for V2.0. --- Lib/irix5/FL.py | 64 +++++++++++++++++++++++++------------------- Lib/plat-irix5/FL.py | 64 +++++++++++++++++++++++++------------------- 2 files changed, 74 insertions(+), 54 deletions(-) diff --git a/Lib/irix5/FL.py b/Lib/irix5/FL.py index 43c9904f638..100d05f0e33 100755 --- a/Lib/irix5/FL.py +++ b/Lib/irix5/FL.py @@ -1,8 +1,14 @@ # Constants used by the FORMS library (module fl). # This corresponds to "forms.h". # Recommended use: import FL; ... FL.NORMAL_BOX ... etc. +# Alternate use: from FL import *; ... NORMAL_BOX ... etc. -_v15 = 0 +import fl +try: + _v20 = (fl.get_rgbmode <> None) +except: + _v20 = 0 +del fl NULL = 0 FALSE = 0 @@ -11,7 +17,8 @@ TRUE = 1 EVENT = -1 LABEL_SIZE = 64 -SHORTCUT_SIZE = 32 # V2.0 +if _v20: + SHORTCUT_SIZE = 32 PLACE_FREE = 0 PLACE_SIZE = 1 PLACE_ASPECT = 2 @@ -108,7 +115,8 @@ HIDDEN_BUTTON = 3 TOUCH_BUTTON = 4 INOUT_BUTTON = 5 RETURN_BUTTON = 6 -HIDDEN_RET_BUTTON = 7 # V2.0 +if _v20: + HIDDEN_RET_BUTTON = 7 BUTTON_BOXTYPE = UP_BOX BUTTON_COL1 = COL1 BUTTON_COL2 = COL1 @@ -117,20 +125,21 @@ BUTTON_ALIGN = ALIGN_CENTER BUTTON_MCOL1 = MCOL BUTTON_MCOL2 = MCOL BUTTON_BW = BOUND_WIDTH -CHART = 4 # V2.0 -BAR_CHART = 0 # V2.0 -HORBAR_CHART = 1 # V2.0 -LINE_CHART = 2 # V2.0 -FILLED_CHART = 3 # V2.0 -SPIKE_CHART = 4 # V2.0 -PIE_CHART = 5 # V2.0 -SPECIALPIE_CHART = 6 # V2.0 -CHART_BOXTYPE = BORDER_BOX # V2.0 -CHART_COL1 = COL1 # V2.0 -CHART_LCOL = LCOL # V2.0 -CHART_ALIGN = ALIGN_BOTTOM # V2.0 -CHART_BW = BOUND_WIDTH # V2.0 -CHART_MAX = 128 # V2.0 +if _v20: + CHART = 4 + BAR_CHART = 0 + HORBAR_CHART = 1 + LINE_CHART = 2 + FILLED_CHART = 3 + SPIKE_CHART = 4 + PIE_CHART = 5 + SPECIALPIE_CHART = 6 + CHART_BOXTYPE = BORDER_BOX + CHART_COL1 = COL1 + CHART_LCOL = LCOL + CHART_ALIGN = ALIGN_BOTTOM + CHART_BW = BOUND_WIDTH + CHART_MAX = 128 CHOICE = 42 NORMAL_CHOICE = 0 CHOICE_BOXTYPE = DOWN_BOX @@ -160,11 +169,12 @@ COUNTER_COL1 = COL1 COUNTER_COL2 = 4 COUNTER_LCOL = LCOL COUNTER_ALIGN = ALIGN_BOTTOM -COUNTER_BW = BOUND_WIDTH # V2.0 -if _v15: - DEFAULT = 51 # V1.5 - RETURN_DEFAULT = 0 # V1.5 - ALWAYS_DEFAULT = 1 # V1.5 +if _v20: + COUNTER_BW = BOUND_WIDTH +else: + DEFAULT = 51 + RETURN_DEFAULT = 0 + ALWAYS_DEFAULT = 1 DIAL = 22 NORMAL_DIAL = 0 LINE_DIAL = 1 @@ -183,12 +193,12 @@ CONTINUOUS_FREE = 4 ALL_FREE = 5 INPUT = 31 NORMAL_INPUT = 0 -if _v15: - ALWAYS_INPUT = 1 # V1.5 -- Warning: collides with next +if _v20: + FLOAT_INPUT = 1 + INT_INPUT = 2 + HIDDEN_INPUT = 3 else: - FLOAT_INPUT = 1 # V2.0 -INT_INPUT = 2 # V2.0 -HIDDEN_INPUT = 3 # V2.0 + ALWAYS_INPUT = 1 INPUT_BOXTYPE = DOWN_BOX INPUT_COL1 = 13 INPUT_COL2 = 5 diff --git a/Lib/plat-irix5/FL.py b/Lib/plat-irix5/FL.py index 43c9904f638..100d05f0e33 100755 --- a/Lib/plat-irix5/FL.py +++ b/Lib/plat-irix5/FL.py @@ -1,8 +1,14 @@ # Constants used by the FORMS library (module fl). # This corresponds to "forms.h". # Recommended use: import FL; ... FL.NORMAL_BOX ... etc. +# Alternate use: from FL import *; ... NORMAL_BOX ... etc. -_v15 = 0 +import fl +try: + _v20 = (fl.get_rgbmode <> None) +except: + _v20 = 0 +del fl NULL = 0 FALSE = 0 @@ -11,7 +17,8 @@ TRUE = 1 EVENT = -1 LABEL_SIZE = 64 -SHORTCUT_SIZE = 32 # V2.0 +if _v20: + SHORTCUT_SIZE = 32 PLACE_FREE = 0 PLACE_SIZE = 1 PLACE_ASPECT = 2 @@ -108,7 +115,8 @@ HIDDEN_BUTTON = 3 TOUCH_BUTTON = 4 INOUT_BUTTON = 5 RETURN_BUTTON = 6 -HIDDEN_RET_BUTTON = 7 # V2.0 +if _v20: + HIDDEN_RET_BUTTON = 7 BUTTON_BOXTYPE = UP_BOX BUTTON_COL1 = COL1 BUTTON_COL2 = COL1 @@ -117,20 +125,21 @@ BUTTON_ALIGN = ALIGN_CENTER BUTTON_MCOL1 = MCOL BUTTON_MCOL2 = MCOL BUTTON_BW = BOUND_WIDTH -CHART = 4 # V2.0 -BAR_CHART = 0 # V2.0 -HORBAR_CHART = 1 # V2.0 -LINE_CHART = 2 # V2.0 -FILLED_CHART = 3 # V2.0 -SPIKE_CHART = 4 # V2.0 -PIE_CHART = 5 # V2.0 -SPECIALPIE_CHART = 6 # V2.0 -CHART_BOXTYPE = BORDER_BOX # V2.0 -CHART_COL1 = COL1 # V2.0 -CHART_LCOL = LCOL # V2.0 -CHART_ALIGN = ALIGN_BOTTOM # V2.0 -CHART_BW = BOUND_WIDTH # V2.0 -CHART_MAX = 128 # V2.0 +if _v20: + CHART = 4 + BAR_CHART = 0 + HORBAR_CHART = 1 + LINE_CHART = 2 + FILLED_CHART = 3 + SPIKE_CHART = 4 + PIE_CHART = 5 + SPECIALPIE_CHART = 6 + CHART_BOXTYPE = BORDER_BOX + CHART_COL1 = COL1 + CHART_LCOL = LCOL + CHART_ALIGN = ALIGN_BOTTOM + CHART_BW = BOUND_WIDTH + CHART_MAX = 128 CHOICE = 42 NORMAL_CHOICE = 0 CHOICE_BOXTYPE = DOWN_BOX @@ -160,11 +169,12 @@ COUNTER_COL1 = COL1 COUNTER_COL2 = 4 COUNTER_LCOL = LCOL COUNTER_ALIGN = ALIGN_BOTTOM -COUNTER_BW = BOUND_WIDTH # V2.0 -if _v15: - DEFAULT = 51 # V1.5 - RETURN_DEFAULT = 0 # V1.5 - ALWAYS_DEFAULT = 1 # V1.5 +if _v20: + COUNTER_BW = BOUND_WIDTH +else: + DEFAULT = 51 + RETURN_DEFAULT = 0 + ALWAYS_DEFAULT = 1 DIAL = 22 NORMAL_DIAL = 0 LINE_DIAL = 1 @@ -183,12 +193,12 @@ CONTINUOUS_FREE = 4 ALL_FREE = 5 INPUT = 31 NORMAL_INPUT = 0 -if _v15: - ALWAYS_INPUT = 1 # V1.5 -- Warning: collides with next +if _v20: + FLOAT_INPUT = 1 + INT_INPUT = 2 + HIDDEN_INPUT = 3 else: - FLOAT_INPUT = 1 # V2.0 -INT_INPUT = 2 # V2.0 -HIDDEN_INPUT = 3 # V2.0 + ALWAYS_INPUT = 1 INPUT_BOXTYPE = DOWN_BOX INPUT_COL1 = 13 INPUT_COL2 = 5