PB_Any Generates Very Large Constant
Posted: Tue Aug 23, 2005 8:43 pm
I'm trying to dynamically generate a form from a database using #PB_Any The code seemed to run fine (the form is generated) until I started to manipulate the created gadgets. Then I got the compile error "Very large constant...". So I added a Debug, and low and behold, the constants generated were 14086180, and similiar. I'm using both static and dynamic constants, the last enumerated constant was 61. Why is PB_Any generating such a large value.
The program is pretty big....so the following code is just the code used to generate the gadgets. It also requires the database to run, but here it is. Any help would be greatly appreciated.
Joy
Debug "LAST ENUM CONSTANT"
Debug #Image_Dimensions_ButtonDown
ILFilename.s = "DataFiles\Interactive.dbf"
hdbInteractive.l = xdbOpen(ILFilename, "")
IndexName.s="DataFiles\GadgetType.idx"
idxHandle.l = xdbOpenIndex(IndexName, hdbInteractive)
FormRSR.l = xdbSeek(hdbInteractive,idxHandle,"Form")
If FormRSR = XDBFALSE
Debug "NOT FOUND"
EndIf
;- Read Form Values
GadgetName.s = xdbFieldValue(hdbInteractive, "G_NAME", 0)
GadgetX.s = xdbFieldValue(hdbInteractive, "GADGET_X",0)
GadgetY.s = xdbFieldValue(hdbInteractive, "GADGET_Y",0)
GadgetWidth.s = xdbFieldValue(hdbInteractive, "G_WIDTH",0)
GadgetHeight.s = xdbFieldValue(hdbInteractive, "G_HEIGHT",0)
GadgetSkin.s = xdbFieldValue(hdbInteractive, "G_IMAGE",0)
TemplateName.s = xdbFieldValue(hdbInteractive, "TEMPLATE",0)
Debug "FORM"
Debug "Gadget No"
Debug "Gadget Height"
Debug GadgetHeight
Debug "Template Name"
Debug TemplateName
Debug "Gadget Name"
Debug GadgetName
Debug "Skin"
Debug GadgetSkin
;- Create Interactive Form
If OpenWindow(#Window_TemplateA_001, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), #PB_Window_BorderLess|#PB_Window_Invisible, TemplateName)
SetWindowCallback(@WindowCallback())
If CreateGadgetList(WindowID(#Window_TemplateA_001))
PureSkin(#Window_TemplateA_001, #Gadget_TemplateA_001_xPureSkin2, #Image_TemplateA_001_xPureSkin2, GadgetSkin,0)
AdvancedGadgetEvents(#True)
NoOfRecords = xdbRecordCount(hdbInteractive)
For x = 1 To NoOfRecords
xdbGetRecord(hdbInteractive, x)
GadgetType.s = xdbFieldValue(hdbInteractive, "G_TYPE", 0)
GadgetName = xdbFieldValue(hdbInteractive, "G_NAME", 0)
GadgetNo.s = xdbFieldValue(hdbInteractive, "G_NO",0)
GadgetX = xdbFieldValue(hdbInteractive, "GADGET_X",0)
GadgetY = xdbFieldValue(hdbInteractive, "GADGET_Y",0)
GadgetWidth = xdbFieldValue(hdbInteractive, "G_WIDTH",0)
GadgetHeight = xdbFieldValue(hdbInteractive, "G_HEIGHT",0)
FontName.s = xdbFieldValue(hdbInteractive, "FONTNAME",0)
FontYSize.s = xdbFieldValue(hdbInteractive, "FONTSIZE",0)
LabelText.s = xdbFieldValue(hdbInteractive, "VAL_TEXT",0)
GadgetVisible.s = xdbFieldValue(hdbInteractive, "G_SHOW",0)
TextColor.s = xdbFieldValue(hdbInteractive, "TXT_COLR",0)
BkgrdColor.s = xdbFieldValue(hdbInteractive, "BK_COLOR",0)
FieldText.s = xdbFieldValue(hdbInteractive, "FLD_VAL",0)
Alignment.s = xdbFieldValue(hdbInteractive, "G_ALIGN",0)
FontType.s = xdbFieldValue(hdbInteractive, "FONTTYPE",0)
ButtonType.s = xdbFieldValue(hdbInteractive, "VAL_TYPE",0)
If GadgetVisible = "Yes"
GNo = Val(GadgetNo)
If GadgetType = "Label"
FontYSizeSel = Val(FontYSize)
TextColorNew.l = Val(TextColor)
BkgrdColorNew.l = Val(BkgrdColor)
Select FontType
Case "Standard"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
Debug "SEE LABEL CONSTANT"
Debug Label(GNo)
;SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
EndSelect
Case "Italic"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , RGBTextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
EndSelect
Case "Bold"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
Case "Bold/Italic"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
EndSelect
Debug "LABEL"
Debug GadgetName
EndIf
If GadgetType = "Field"
FontYSizeSel = Val(FontYSize)
TextColorNew.l = Val(TextColor)
BkgrdColorNew.l = Val(BkgrdColor)
Select FontType
Case "Standard"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
EndSelect
Case "Italic"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
EndSelect
Case "Bold"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
Case "Bold/Italic"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
EndSelect
Debug "Field"
Debug GadgetName
EndIf
If GadgetType = "Button"
FontYSizeSel = Val(FontYSize)
TextColorNew.l = Val(TextColor)
BkgrdColorNew.l = Val(BkgrdColor)
Select ButtonType
Case "Standard"
Button(GNo) = ButtonGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Button_MultiLine)
PureCOLOR_SetButtonColor(Button(GNo), TextColorNew, BkgrdColorNew)
Debug "Standard Button"
;SetGadgetFont(Button(GNo), LoadFont(#FFont_35, FontName, FontYSize))
Case "Image"
;Button(GadgetNo) = ButtonImageGadget(#PB_Any, GadgetX , GadgetY, GadgetWidth, GadgetHeight, FieldText, #PB_Font_Italic)
Button(GNo) = PVGadgets_TransparentButtonImageGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight),"Images\button_icon.bmp")
PureCOLOR_SetButtonColor(Button(GNo), TextColorNew, BkgrdColorNew)
Debug "Image Button"
;SetGadgetFont(Button(GNo), LoadFont(#FFont_35, FontName, FontYSize))
Case "Toggle"
Button(GNo) = ButtonGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Button_Toggle | #PB_Button_MultiLine)
PureCOLOR_SetButtonColor(Button(GNo), TextColorNew, BkgrdColorNew)
;SetGadgetFont(Button(GNo), LoadFont(#FFont_35, FontName, FontYSize))
Debug "Toggle button"
EndSelect
EndIf
EndIf
Next
PureSkinHide(#Window_TemplateA_001,0)
EndIf
EndIf
The program is pretty big....so the following code is just the code used to generate the gadgets. It also requires the database to run, but here it is. Any help would be greatly appreciated.
Joy
Debug "LAST ENUM CONSTANT"
Debug #Image_Dimensions_ButtonDown
ILFilename.s = "DataFiles\Interactive.dbf"
hdbInteractive.l = xdbOpen(ILFilename, "")
IndexName.s="DataFiles\GadgetType.idx"
idxHandle.l = xdbOpenIndex(IndexName, hdbInteractive)
FormRSR.l = xdbSeek(hdbInteractive,idxHandle,"Form")
If FormRSR = XDBFALSE
Debug "NOT FOUND"
EndIf
;- Read Form Values
GadgetName.s = xdbFieldValue(hdbInteractive, "G_NAME", 0)
GadgetX.s = xdbFieldValue(hdbInteractive, "GADGET_X",0)
GadgetY.s = xdbFieldValue(hdbInteractive, "GADGET_Y",0)
GadgetWidth.s = xdbFieldValue(hdbInteractive, "G_WIDTH",0)
GadgetHeight.s = xdbFieldValue(hdbInteractive, "G_HEIGHT",0)
GadgetSkin.s = xdbFieldValue(hdbInteractive, "G_IMAGE",0)
TemplateName.s = xdbFieldValue(hdbInteractive, "TEMPLATE",0)
Debug "FORM"
Debug "Gadget No"
Debug "Gadget Height"
Debug GadgetHeight
Debug "Template Name"
Debug TemplateName
Debug "Gadget Name"
Debug GadgetName
Debug "Skin"
Debug GadgetSkin
;- Create Interactive Form
If OpenWindow(#Window_TemplateA_001, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), #PB_Window_BorderLess|#PB_Window_Invisible, TemplateName)
SetWindowCallback(@WindowCallback())
If CreateGadgetList(WindowID(#Window_TemplateA_001))
PureSkin(#Window_TemplateA_001, #Gadget_TemplateA_001_xPureSkin2, #Image_TemplateA_001_xPureSkin2, GadgetSkin,0)
AdvancedGadgetEvents(#True)
NoOfRecords = xdbRecordCount(hdbInteractive)
For x = 1 To NoOfRecords
xdbGetRecord(hdbInteractive, x)
GadgetType.s = xdbFieldValue(hdbInteractive, "G_TYPE", 0)
GadgetName = xdbFieldValue(hdbInteractive, "G_NAME", 0)
GadgetNo.s = xdbFieldValue(hdbInteractive, "G_NO",0)
GadgetX = xdbFieldValue(hdbInteractive, "GADGET_X",0)
GadgetY = xdbFieldValue(hdbInteractive, "GADGET_Y",0)
GadgetWidth = xdbFieldValue(hdbInteractive, "G_WIDTH",0)
GadgetHeight = xdbFieldValue(hdbInteractive, "G_HEIGHT",0)
FontName.s = xdbFieldValue(hdbInteractive, "FONTNAME",0)
FontYSize.s = xdbFieldValue(hdbInteractive, "FONTSIZE",0)
LabelText.s = xdbFieldValue(hdbInteractive, "VAL_TEXT",0)
GadgetVisible.s = xdbFieldValue(hdbInteractive, "G_SHOW",0)
TextColor.s = xdbFieldValue(hdbInteractive, "TXT_COLR",0)
BkgrdColor.s = xdbFieldValue(hdbInteractive, "BK_COLOR",0)
FieldText.s = xdbFieldValue(hdbInteractive, "FLD_VAL",0)
Alignment.s = xdbFieldValue(hdbInteractive, "G_ALIGN",0)
FontType.s = xdbFieldValue(hdbInteractive, "FONTTYPE",0)
ButtonType.s = xdbFieldValue(hdbInteractive, "VAL_TYPE",0)
If GadgetVisible = "Yes"
GNo = Val(GadgetNo)
If GadgetType = "Label"
FontYSizeSel = Val(FontYSize)
TextColorNew.l = Val(TextColor)
BkgrdColorNew.l = Val(BkgrdColor)
Select FontType
Case "Standard"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
Debug "SEE LABEL CONSTANT"
Debug Label(GNo)
;SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
EndSelect
Case "Italic"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , RGBTextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
EndSelect
Case "Bold"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
Case "Bold/Italic"
Select Alignment
Case "Left"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Label(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), LabelText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Label(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Label(GNo), LoadFont(Label(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
EndSelect
Debug "LABEL"
Debug GadgetName
EndIf
If GadgetType = "Field"
FontYSizeSel = Val(FontYSize)
TextColorNew.l = Val(TextColor)
BkgrdColorNew.l = Val(BkgrdColor)
Select FontType
Case "Standard"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
EndSelect
Case "Italic"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Italic))
EndSelect
Case "Bold"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
Case "Bold/Italic"
Select Alignment
Case "Left"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Center"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Center | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
Case "Right"
Field(GNo) = StringGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Text_Right | #PB_String_BorderLess )
PureCOLOR_SetGadgetColor(Field(GNo) , TextColorNew, BkgrdColorNew)
SetGadgetFont(Field(GNo), LoadFont(Field(GNo), FontName, FontYSizeSel, #PB_Font_Bold))
EndSelect
EndSelect
Debug "Field"
Debug GadgetName
EndIf
If GadgetType = "Button"
FontYSizeSel = Val(FontYSize)
TextColorNew.l = Val(TextColor)
BkgrdColorNew.l = Val(BkgrdColor)
Select ButtonType
Case "Standard"
Button(GNo) = ButtonGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Button_MultiLine)
PureCOLOR_SetButtonColor(Button(GNo), TextColorNew, BkgrdColorNew)
Debug "Standard Button"
;SetGadgetFont(Button(GNo), LoadFont(#FFont_35, FontName, FontYSize))
Case "Image"
;Button(GadgetNo) = ButtonImageGadget(#PB_Any, GadgetX , GadgetY, GadgetWidth, GadgetHeight, FieldText, #PB_Font_Italic)
Button(GNo) = PVGadgets_TransparentButtonImageGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight),"Images\button_icon.bmp")
PureCOLOR_SetButtonColor(Button(GNo), TextColorNew, BkgrdColorNew)
Debug "Image Button"
;SetGadgetFont(Button(GNo), LoadFont(#FFont_35, FontName, FontYSize))
Case "Toggle"
Button(GNo) = ButtonGadget(#PB_Any, Val(GadgetX) , Val(GadgetY), Val(GadgetWidth), Val(GadgetHeight), FieldText, #PB_Button_Toggle | #PB_Button_MultiLine)
PureCOLOR_SetButtonColor(Button(GNo), TextColorNew, BkgrdColorNew)
;SetGadgetFont(Button(GNo), LoadFont(#FFont_35, FontName, FontYSize))
Debug "Toggle button"
EndSelect
EndIf
EndIf
Next
PureSkinHide(#Window_TemplateA_001,0)
EndIf
EndIf