// // WINMOVE.VDM Ch. Ziemski 11.09.2001 // 14.10.2001 // // Demo macro to show and test the Dialog_Input_1() and the WIN_MOVE(APP, ...) commands // // Requires: VEDIT 6.01 or above // // // Since it's a demo this macro doesn't take care about already used registers! // //--------------------------------------------------------------------------------------- // save the initial position and size for UNDO #81=APP_X_ORG #82=APP_Y_ORG #83=APP_WIDTH #84=APP_HEIGHT // set some defaults #91=0 // Checkbox: unchecked #92=1 // Radiobox: "position" ITOA(10, 95, LEFT+NOCR) // default pixel increment for moving/resizing // the long text shown in the Dialog_Input_1() Reg_Set(50, 'Here you can move and resize the VEDIT application interactively. (Quit with the [Quit] button or the key) Be sure to save your work before using this! High values can make VEDIT invisible (Out of the screen. Solution: [Undo] button or a right mouse click on VEDIT in the taskbar and choose ´Maximize´.) ') // info item for "undoing": Reg_Set(51, "-nothing-") //-------------------------------------------------------------------- // endless main loop until pressed repeat(ALL){ // get the current position and size values for later use #71=APP_X_ORG #72=APP_Y_ORG #73=APP_WIDTH #74=APP_HEIGHT // and write them into text registers to display them ITOA(#71, 91, LEFT+NOCR) ITOA(#72, 92, LEFT+NOCR) ITOA(#73, 93, LEFT+NOCR) ITOA(#74, 94, LEFT+NOCR) #77=Dialog_Input_1(91," 'Demo for Dialog_Input_1() and Win_Move()', '|@(50)', '?? APP_X_Org', '?? APP_Y_Org', '?? APP_Width', '?? APP_Height', '.l[Set]', '.h[]Set to PseudoMax', '.v.l[Und&o (once) the last:]', '.h.l.C |@(51) ', '.c--------------------------------------------------------', '.cOr set the position/size stepwise', '?? with # of pixels per step:', '.c()position', '.h()size', '.v[&up/smaller]', '.v[&left/narrower]', '.h[&right/wider]', '.v[&down/bigger]', '.c--------------------------------------------------------', '.c[&Quit this demo macro]'", SET+SCREEN+CENTER,0,0) // and now check what button/key the user has pressed: if(#77==0){ break } // end the loop if if(#77==7){ break } // end the loop if [Quit] if(#77==2){ // [Undo] #71=#81 #72=#82 #73=#83 #74=#84 Reg_Set(51, "-nothing-") }else{ #81=APP_X_ORG // remember current values for the next Undo #82=APP_Y_ORG #83=APP_WIDTH #84=APP_HEIGHT if(#77==1){ // [Set] if(#91==1){ // if pseudo maximize checked #71=-4 #72=-4 #73=Desktop_Width+8 #74=Desktop_Height+6 #90=0 Reg_Set(51,"Set pseudo maximize") }else{ // set from input fields #71=ATOI(91) // write the values from the input fileds #72=ATOI(92) // into numerical registers #73=ATOI(93) #74=ATOI(94) Reg_Set(51,"Set via values") } }else{ // if incremental buttons are pressed #78=ATOI(95) // get pixel increment if(#92==1){ // if (position) was chosen if(#77==3){ // up #72-=#78 Reg_Set(51,"up move") }else{ if(#77==4){ // left #71-=#78 Reg_Set(51,"left move") }else{ if(#77==5){ // right #71+=#78 Reg_Set(51,"right move") }else{ if(#77==6){ // down #72+=#78 Reg_Set(51,"down move") } } } } }else{ // if (size) was chosen if(#77==3){ // smaller #74-=#78 Reg_Set(51,"resize smaller") }else{ if(#77==4){ // narrower #73-=#78 Reg_Set(51,"resize narrower") }else{ if(#77==5){ // wider #73+=#78 Reg_Set(51,"resize wider") }else{ if(#77==6){ // higher #74+=#78 Reg_Set(51,"resize higher") } } } } } } } Win_Move(APP, #71, #72, #73, #74) // and now use the new values to move/resize VEDIT }