INCLUDE "datetest.4gh" FORWARD dateTestWCL INCLUDE SYSTEM "ixconn.4gh" GLOBAL VARIABLE dateTestWN dateTestWCL VARIABLE mPickDateWN pickDateWCL MAIN CALL ixSQLConnect::getImplicitConnection().connect("STORES6") LET dateTestWN = NEW dateTestWCL() CALL dateTestWN.open() RETURN END MAIN HANDLER dateTestWCL::dateTestWN_start() RETURNING VOID VARIABLE myST ixSuperTable VARIABLE rowNum INTEGER # initialize the date picker. LET mPickDateWN = NEW pickDateWCL(containingWindow: getWindow(), shown: FALSE, windowStyle: ixWindow::modalPopup) CALL mpickDateWN.open() LET myST = getContainedObjByName("SuperTable2") LET rownum = myST.insert() END HANDLER -- dateTestWCL::dateTestWN_start HANDLER ixSuperField::dateTestWN_SuperField34_rightMouseClick(vertical INTEGER, horizontal INTEGER) RETURNING VOID # call the pickDate popup via a common function CALL mPickDateWN.pickDateForSF(self, getVisualContainer()) END HANDLER -- ixSuperField::dateTestWN_SuperField34_rightMouseClick HANDLER ixButton::dateTestWN_Button67_activate() RETURNING VOID VARIABLE ok BOOLEAN VARIABLE superTable ixSuperTable VARIABLE myWN ixWindow LET superTable = (getVisualContainer() CAST ixSuperTable) LET ok = superTable.revert() LET myWN = getWindow() IF myWN.close() THEN END IF END HANDLER -- ixButton::dateTestWN_Button67_activate HANDLER ixTextBox::dateTestWN_TextBox80_rightMouseClick(vertical INTEGER, horizontal INTEGER) RETURNING VOID # this is how to use the pickdate() stuff on a non-SuperField VARIABLE myDate ixDate VARIABLE lDate DATE VARIABLE cDate CHAR(*) # focus back in CALL focus() LET cDate = getText() # since we might be in displayQuery mode, # make sure the contents can be a date LET myDate = NEW ixDate(value: NULL) CALL myDate.setValueStr(cDate) IF myDate.isNull() THEN # could not convert the string to a date LET lDate = NULL ELSE LET lDate = myDate.getValueStr() END IF IF lDate IS NOT NULL THEN CALL mPickDateWN.setDate(lDate) END IF CALL mPickDateWN.setLocation(getWindow(),self.getTop(),self.getLeft()) CALL mPickDateWN.show() LET lDate = mPickDateWN.getDate() LET cDate = lDate USING "mm/dd/yyyy" CALL setText(cDate) CALL focus() END HANDLER -- ixTextBox::dateTestWN_TextBox80_rightMouseClick HANDLER ixSuperField::dateTestWN_SuperField1213_rightMouseClick(vertical INTEGER, horizontal INTEGER) RETURNING VOID # call the pickDate popup via a common function CALL mPickDateWN.pickDateForSF(self, getVisualContainer()) END HANDLER -- ixSuperField::dateTestWN_SuperField1213_rightMouseClick HANDLER ixSuperField::dateTestWN_SuperField1516_rightMouseClick(vertical INTEGER, horizontal INTEGER) RETURNING VOID # call the pickDate popup via a common function CALL mPickDateWN.pickDateForSF(self, getVisualContainer()) END HANDLER -- ixSuperField::dateTestWN_SuperField1516_rightMouseClick FUNCTION dateTestWCL::dateTestWCL( geometry ixGeometry, appearance ixAppearance, windowStyle SMALLINT, containingWindow ixWindow, title CHAR(*), enabled BOOLEAN, helpFile CHAR(*), name CHAR(*), helpNum INTEGER, source BOOLEAN, shown BOOLEAN, topicName CHAR(*), icon CHAR(*) ) : ixWindow( containingWindow : containingWindow, name : name, enabled : enabled, shown : shown, helpNum : helpNum, geometry : geometry, appearance : appearance, helpFile : helpFile, title : title, icon : icon, windowStyle : windowStyle, topicName : topicName, source : source ) VARIABLE itemList ixVector VARIABLE includeTable ixRow VARIABLE result INTEGER LET result = 0 HANDLE start WITH dateTestWCL::dateTestWN_start LET SuperTable2 = NEW ixSuperTable( geometry : NEW ixGeometry( top : 420, left : 150, height : 3720, width : 6780 ), appearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), updateTable : "datetest", numDisplayedRows : 1, maxRows : NULL, selectUnique : FALSE, numDisplayedCols : 3, enabled : TRUE, selectFromPart : "datetest", selectJoinPart : NULL, selectOrderbyPart : NULL, borderWidth : 20, name : "SuperTable2", helpNum : 0, shown : TRUE, layout : ixSuperTable::freeForm, displayMode : ixSuperTable::displayData, selectFilterPart : NULL, dbConnection : NULL, lockMode : ixSuperTable::noLock, container : SELF ) LET includeTable = NEW ixRow() LET SuperField34 = NEW ixSuperField( geometry : NEW ixGeometry( top : 910, left : 1373, height : 440, width : 1645 ), appearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), titleGeometry : NEW ixGeometry( top : 910, left : 490, height : 440, width : 548 ), titleAppearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), colInfo : NEW ixColumn( type : 7, encLength : 4, nullable : FALSE, tableName : "datetest", columnName : "dte" ), maxDataChars : 10, title : "dte", tabIndex : NULL, tabEnabled : TRUE, name : "SuperField34", helpNum : 0, shown : TRUE, initialQueryValue : NULL, initialDataValue : NULL, dataState : ixSuperField::enabledState, titleJustify : ixSuperField::rightJustify, primaryKey : TRUE, SQLRole : ixSuperField::updateRole, queryState : ixSuperField::enabledState, multiLine : FALSE, colNum : 1, pictureString : NULL, superTable : SuperTable2 ) CALL SuperField34.setFormat(NULL) CALL SuperField34.setDataJustify(ixSuperField::leftJustify) CALL SuperField34.setShiftPolicy(ixSuperField::noShift) LET SuperField34.required = FALSE LET SuperField34.verify = FALSE LET SuperField34.includeTable = includeTable LET SuperField34.useIncludes = FALSE LET SuperField34.autoNextOn = FALSE LET SuperField34.blobEditor = NULL HANDLE SuperField34.rightMouseClick WITH ixSuperField::dateTestWN_SuperField34_rightMouseClick LET Button67 = NEW ixButton( geometry : NEW ixGeometry( top : 3065, left : 2575, height : 480, width : 1445 ), appearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), title : "OK", enabled : TRUE, tabIndex : NULL, tabEnabled : TRUE, theDefault : FALSE, name : "Button67", helpNum : 0, shown : TRUE, container : SuperTable2 ) HANDLE Button67.activate WITH ixButton::dateTestWN_Button67_activate LET TextBox80 = NEW ixTextBox( geometry : NEW ixGeometry( top : 945, left : 4470, height : 420, width : 1350 ), appearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), enabled : TRUE, tabIndex : NULL, tabEnabled : TRUE, maxChars : 10, name : "TextBox80", helpNum : 0, shown : TRUE, text : NULL, multiLine : FALSE, container : SuperTable2 ) HANDLE TextBox80.rightMouseClick WITH ixTextBox::dateTestWN_TextBox80_rightMouseClick LET Label81 = NEW ixLabel( geometry : NEW ixGeometry( top : 1005, left : 3660, height : 375, width : 675 ), appearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), name : "Label81", shown : TRUE, labelJustify : ixLabel::leftJustify, text : "Text", container : SuperTable2 ) LET includeTable = NEW ixRow() LET SuperField1213 = NEW ixSuperField( geometry : NEW ixGeometry( top : 1510, left : 1388, height : 440, width : 4660 ), appearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), titleGeometry : NEW ixGeometry( top : 1510, left : 160, height : 440, width : 908 ), titleAppearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), colInfo : NEW ixColumn( type : 10, encLength : 2566, nullable : TRUE, tableName : "datetest", columnName : "dtmyth" ), maxDataChars : 25, title : "dtmyth", tabIndex : NULL, tabEnabled : TRUE, name : "SuperField1213", helpNum : 0, shown : TRUE, initialQueryValue : NULL, initialDataValue : NULL, dataState : ixSuperField::enabledState, titleJustify : ixSuperField::rightJustify, primaryKey : FALSE, SQLRole : ixSuperField::updateRole, queryState : ixSuperField::enabledState, multiLine : FALSE, colNum : 2, pictureString : NULL, superTable : SuperTable2 ) CALL SuperField1213.setFormat(NULL) CALL SuperField1213.setDataJustify(ixSuperField::leftJustify) CALL SuperField1213.setShiftPolicy(ixSuperField::noShift) LET SuperField1213.required = FALSE LET SuperField1213.verify = FALSE LET SuperField1213.includeTable = includeTable LET SuperField1213.useIncludes = FALSE LET SuperField1213.autoNextOn = FALSE LET SuperField1213.blobEditor = NULL HANDLE SuperField1213.rightMouseClick WITH ixSuperField::dateTestWN_SuperField1213_rightMouseClick LET includeTable = NEW ixRow() LET SuperField1516 = NEW ixSuperField( geometry : NEW ixGeometry( top : 2110, left : 1388, height : 440, width : 4660 ), appearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), titleGeometry : NEW ixGeometry( top : 2110, left : 160, height : 440, width : 908 ), titleAppearance : NEW ixAppearance( fontName : NULL, fontSize : NULL, fontBold : NULL, fontItalic : NULL, fontUnderline : NULL, foreColor : NULL, backColor : NULL ), colInfo : NEW ixColumn( type : 10, encLength : 3594, nullable : TRUE, tableName : "datetest", columnName : "dtmyts" ), maxDataChars : 25, title : "dtmyts", tabIndex : NULL, tabEnabled : TRUE, name : "SuperField1516", helpNum : 0, shown : TRUE, initialQueryValue : NULL, initialDataValue : NULL, dataState : ixSuperField::enabledState, titleJustify : ixSuperField::rightJustify, primaryKey : FALSE, SQLRole : ixSuperField::updateRole, queryState : ixSuperField::enabledState, multiLine : FALSE, colNum : 3, pictureString : NULL, superTable : SuperTable2 ) CALL SuperField1516.setFormat(NULL) CALL SuperField1516.setDataJustify(ixSuperField::leftJustify) CALL SuperField1516.setShiftPolicy(ixSuperField::noShift) LET SuperField1516.required = FALSE LET SuperField1516.verify = FALSE LET SuperField1516.includeTable = includeTable LET SuperField1516.useIncludes = FALSE LET SuperField1516.autoNextOn = FALSE LET SuperField1516.blobEditor = NULL HANDLE SuperField1516.rightMouseClick WITH ixSuperField::dateTestWN_SuperField1516_rightMouseClick END FUNCTION -- dateTestWCL::dateTestWCL