/*:VRX Main */ /* Main */ Main: /* Process the arguments. Get the parent window. */ parse source . calledAs . parent = "" argCount = arg() argOff = 0 if( calledAs \= "COMMAND" )then do if argCount >= 1 then do parent = arg(1) argCount = argCount - 1 argOff = 1 end end; else do call VROptions 'ImplicitNames' call VROptions 'NoEchoQuit' end InitArgs.0 = argCount if( argCount > 0 )then do i = 1 to argCount InitArgs.i = arg( i + argOff ) end drop calledAs argCount argOff /* Load the windows */ call VRInit parse source . . spec _VREPrimaryWindowPath = , VRParseFileName( spec, "dpn" ) || ".VRW" _VREPrimaryWindow = , VRLoad( parent, _VREPrimaryWindowPath ) drop parent spec if( _VREPrimaryWindow == "" )then do call VRMessage "", "Cannot load window:" VRError(), , "Error!" _VREReturnValue = 32000 signal _VRELeaveMain end /* Process events */ call Init signal on halt do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) ) _VREEvent = VREvent() interpret _VREEvent end _VREHalt: _VREReturnValue = Fini() call VRDestroy _VREPrimaryWindow _VRELeaveMain: call VRFini exit _VREReturnValue VRLoadSecondary: __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 ) if __vrlsWait then do call VRFlush end __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) ) if __vrlsHWnd = '' then signal __vrlsDone if __vrlsWait \= 1 then signal __vrlsDone call VRSet __vrlsHWnd, 'WindowMode', 'Modal' __vrlsTmp = __vrlsWindows.0 if( DataType(__vrlsTmp) \= 'NUM' ) then do __vrlsTmp = 1 end else do __vrlsTmp = __vrlsTmp + 1 end __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd ) __vrlsWindows.0 = __vrlsTmp do while( VRIsValidObject( VRWindow() ) = 1 ) __vrlsEvent = VREvent() interpret __vrlsEvent end __vrlsTmp = __vrlsWindows.0 __vrlsWindows.0 = __vrlsTmp - 1 call VRWindow __vrlsWindows.__vrlsTmp __vrlsHWnd = '' __vrlsDone: return __vrlsHWnd /*:VRX __VXREXX____APPENDS__ */ __VXREXX____APPENDS__: /* */ return /*:VRX _ContainerInit */ _ContainerInit: StatusFH = VRMethod("CN_Tickets","AddField", "String", "Status") NrFH = VRMethod("CN_Tickets","AddField", "String", "Nr.") ZunameFH = VRMethod("CN_Tickets","AddField", "String", "Zuname") VornameFH = VRMethod("CN_Tickets","AddField", "String", "Vorname") TicketFH = VRMethod("CN_Tickets","AddField", "String", "Ticket") BarcodeFH = VRMethod("CN_Tickets","AddField", "String", "Barcode") return /*:VRX _toCP437 */ _toCP437: procedure return translate(arg(1),'„”�','äöü') /*:VRX Activate */ Activate: parse arg Nr call PushbackAll CurrentPageNr = Nr /* ok = VRSet("PB_"Nr,"Font","9.WarpSans Bold") */ ok = VRSet("TAB_"Nr,"Top", TabTop-8) ok = VRSet("TAB_"Nr,"Left",TabWidth*(Nr-1)+PageLeft) ok = VRSet("TAB_"Nr,"PicturePath", "#1"||Nr||";#1"||Nr) ok = VRset("DT_PageName", "Caption", VRGet("TAB_"Nr, "UserData")) ok = VRSet("Page_"Nr,"Visible", 1) select when Nr = 1 then ok = VRSet("IPB_paper","PicturePath","#4;#4") when Nr = Pages then ok = VRSet("IPB_paper","PicturePath","#6;#6") otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5") end return /*:VRX Fini */ Fini: window = VRWindow() call VRSet window, "Visible", 0 drop window return 0 /*:VRX GetBootDrive */ GetBootDrive: /* Use SysBootDrive if possible */ If Rxfuncadd('SysBootDrive', 'RexxUtil', 'SysBootDrive') Then Return Left(Value('RUNWORKPLACE',,'OS2ENVIRONMENT'),2) Else Return SysBootDrive() /*:VRX Halt */ Halt: signal _VREHalt return /*:VRX Init */ Init: window = VRWindow() call VRMethod window, "CenterWindow" call VRSet window, "Visible", 0 call VRMethod window, "Activate" drop window return /*:VRX IPB_Paper_Click */ IPB_Paper_Click: if VRInfo("Left") > VRInfo("Top") then call Activate min(CurrentPageNr+1,Pages) if VRInfo("Left") <= VRInfo("Top") then call Activate max(CurrentPageNr-1,1) return /*:VRX Main_Close */ Main_Close: call Quit return /*:VRX Main_Create */ Main_Create: ok = VRMethod("PB_Load","SetFocus") call Page1_Create call Page2_Create call Page3_Create call Page4_Create call Page5_Create call Paper_Init call _ContainerInit ok = VRSet("Main", "Visible", 1) call TAB_1_Click return /*:VRX Main_Resize */ Main_Resize: MainWin = "Main" ok = VRSet(MainWin,"Painting", 0) /* ok = VRset(MainWin,"Visible", 0) */ ok = VRSet(MainWin,"Width",max(VRget(MainWin,"Width"),Pages*TabWidth+300)) ok = VRset("GB_Main","width",VRget(MainWin,"Width")-150) ok = VRset("GB_Main","Height",VRget(MainWin,"Height")-1175) ok = VRset("GB_Main2","width",VRget("GB_Main","Width")-260) ok = VRset("GB_Main2","Height",VRget("GB_Main","Height")-275) ok = VRset("GB_VerticalLine","Left",VRget("GB_Main2","Width")-60) ok = VRset("GB_VerticalLine","Height",VRget("GB_Main2","Height")-410) ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420) ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440) ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440) ok = VRset("GB_LineSubtitle","Width",VRget("GB_Main2","width")-480) do I = 1 to Pages ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600)) ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450)) end ok = VRSEt("PB_Load","top",VRGet("GB_Main","Height")+365) ok = VRSEt("PB_Undo","top",VRGet("GB_Main","Height")+365) ok = VRSEt("PB_Cancel","top",VRGet("GB_Main","Height")+365) ButtonDist= 1080 ButtonNr = 3 ButtonPos = max((VRget(MainWin,"Width")-ButtonDist*ButtonNr)/2,0) ok = VRSEt("PB_Load","Left",ButtonPos+ButtonDist*(ButtonNr-3)) ok = VRSEt("PB_Undo","left",ButtonPos+ButtonDist*(ButtonNr-2)) ok = VRSEt("PB_Cancel","left",ButtonPos+ButtonDist*(ButtonNr-1)) /* check and empty event queue, trash spurious resize events */ EventString = '' TrashedResize = 0 do until EventString = 'nop' EventString = VREvent('N') if EventString <> 'nop' then do if EventString = 'CALL 'MainWin'_Resize' then TrashedResize = 1 else interpret eventString end end if TrashedResize then CALL Main_Resize ok = VRSet(MainWin, "Painting", 1) /* ok = VRset(MainWin,"Visible", 1) */ return /*:VRX Page1_Create */ Page1_Create: Return /*:VRX Page1_Init */ Page1_Init: return /*:VRX Page2_Create */ Page2_create: Return /*:VRX Page2_init */ Page2_init: return /*:VRX Page3_Create */ Page3_create: Return /*:VRX Page3_Init */ Page3_Init: return /*:VRX Page4_Create */ Page4_Create: Return /*:VRX Page4_init */ Page4_init: return /*:VRX Page5_Create */ Page5_Create: return /*:VRX Page5_Init */ Page5_Init: return /*:VRX Paper_Init */ Paper_Init: ok = VRSet("IPB_Paper","Width" ,VRMethod( "Screen", "PixelsToTwips", 32 )) ok = VRSet("IPB_Paper","Height",VRMethod( "Screen", "PixelsToTwips", 32 )) ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420) return /*:VRX PB_Cancel_Click */ PB_Cancel_Click: Call Quit return /*:VRX PB_Load_Click */ PB_Load_Click: FileName = VRFileDialog( VRWindow(), "Ticketdatei ”ffnen", "Open", "*.CSV", , , ) header.1 = linein(Filename) header.2 = linein(Filename) parse var header.1 Veranst.Name';'Veranst.Username';'Veranst.Passwd parse var header.2 Veranst.ID ';' Veranst.Title ok = VRSet("Main","Caption", "eTicketS ["Veranst.Title) I = 0 do while lines(Filename) <> 0 ticketline = linein(Filename) I = I + 1 parse var ticketline TNr.I';'F2.I';'TBarcode.I';'F4.I';'F5.I';'F6.I';'TVeranst.I';'F8.I';'TZuname.I';'TVorname.I';'F11.I';'TType.I';' . TZuname.I = _ToCP437(TZuname.I) /* say TNr.I'|'TBarcode.I'|'TVeranst.I'|'TZuname.I' 'TVorname.I'|'TType.I */ RH = VRMethod("CN_Tickets","AddRecord") ok = VRMethod("CN_Tickets", "SetFieldData", RH, NrFH, I, ZunameFH, TZUname.I, VornameFH, TVorname.I, BarcodeFH,TBarcode.I, TicketFH,TType.I) end ok = stream(Filename,'c','close') TNr.0 = I TBarcode.0 = I TVeranst.0 = I TZuname.0 = I TVorname.0 = I TType.0 = I return /*:VRX PB_Undo_Click */ PB_Undo_Click: Call Page1_create 'no_init' Call Page2_create 'no_init' Call Page3_create 'no_init' Call Page4_create 'no_init' return /*:VRX PushbackAll */ PushbackAll: Pages = 3 /* Tab distance from top */ TabTop = 20 TabWidth = VRMethod( "Screen", "PixelsToTwips", 78 ) TabHeight= VRMethod( "Screen", "PixelsToTwips", 24 ) /* Page Position */ PageLeft = 120 PageTop = PageLeft + TabTop + 330 /* Page size */ PageHeight = 4500 PageWidth = 5700 ok = VRset("DT_PageName", "Caption", "") ok = VRSet("GB_Main","Left", 0) ok = VRSet("GB_Main","Top", TabTop+230) do I = 1 to Pages ok = VRSet("TAB_"I,"Top", TabTop) ok = VRSet("TAB_"I,"PicturePath","#2"||I||";#2"||I) ok = VRSet("TAB_"I,"Left",TabWidth*(I-1)+PageLeft) ok = VRSet("TAB_"I,"Width",TabWidth) ok = VRSet("TAB_"I,"Height",TabHeight) ok = VRSet("Page_"I,"Height", PageHeight) ok = VRSet("Page_"I,"Width", PageWidth) ok = VRSet("Page_"I,"Left", PageLeft) ok = VRSet("Page_"I,"Top", PageTop) ok = VRSet("Page_"I,"Visible", 0) ok = VRSet("Page_"I,"BackColor", "") end return /*:VRX Quit */ Quit: window = VRWindow() call VRSet window, "Shutdown", 1 drop window return /*:VRX TAB_1_Click */ TAB_1_Click: call Activate 1 return /*:VRX TAB_2_Click */ TAB_2_Click: call Activate 2 return /*:VRX TAB_3_Click */ TAB_3_Click: call Activate 3 return /*:VRX TAB_4_Click */ TAB_4_Click: call Activate 4 return /*:VRX TAB_5_Click */ TAB_5_Click: call Activate 5 return