FORWARD INTEGER PROC FNWindowSetSplitSizeHorizontalCreateEqualB( INTEGER i1, INTEGER i2, INTEGER i3 )
FORWARD INTEGER PROC FNWindowSetSplitSizeHorizontalExistEqualB( INTEGER i1, INTEGER i2, INTEGER i3 )
FORWARD PROC Main()
FORWARD PROC PROCWindowCreateHorizontalIterativeSplitN( INTEGER i1 )
PROC Main()
STRING s1[255] = "10"
STRING s2[255] = "318" // Query( windowCols ) at full screen on my monitor // change this to your own value
STRING s3[255] = "81" // Query( windowRows ) at full screen on my monitor // change this to your own value
IF ( NOT ( Ask( "window: set: split: size: horizontal: create: equal: maxI = ", s1, _EDIT_HISTORY_ ) ) AND ( Length( s1 ) > 0 ) ) RETURN() ENDIF
IF ( NOT ( Ask( "window: set: split: size: horizontal: create: equal: maxWidthI = ", s2, _EDIT_HISTORY_ ) ) AND ( Length( s2 ) > 0 ) ) RETURN() ENDIF
IF ( NOT ( Ask( "window: set: split: size: horizontal: create: equal: maxHeigthI = ", s3, _EDIT_HISTORY_ ) ) AND ( Length( s3 ) > 0 ) ) RETURN() ENDIF
Message( FNWindowSetSplitSizeHorizontalCreateEqualB( Val( s1 ), Val( s2 ), Val( s3 ) ) ) // gives e.g. TRUE
END
<F12> Main()
// --- LIBRARY --- //
INTEGER PROC FNWindowSetSplitSizeHorizontalCreateEqualB( INTEGER maxI, INTEGER maxWidthI, INTEGER maxHeigthI )
//
INTEGER B = FALSE
//
PROCWindowCreateHorizontalIterativeSplitN( maxI )
//
B = FNWindowSetSplitSizeHorizontalExistEqualB( maxI, maxWidthI, maxHeigthI )
//
RETURN( B )
//
END
PROC PROCWindowCreateHorizontalIterativeSplitN( INTEGER I )
//
OneWindow()
//
GotoWindow( 1 )
IF ( I == 1 )
RETURN()
ENDIF
//
GotoWindow( 1 )
HWindow() // 1, 2
IF ( I == 2 )
RETURN()
ENDIF
//
GotoWindow( 2 )
HWindow() // 1, 2, 3
IF ( I == 3 )
RETURN()
ENDIF
//
GotoWindow( 3 )
HWindow() // 1, 2, 3, 4
IF ( I == 4 )
RETURN()
ENDIF
//
GotoWindow( 4 )
HWindow() // 1, 2, 3, 4, 5
IF ( I == 5 )
RETURN()
ENDIF
//
GotoWindow( 3 )
HWindow() // 1, 2, 3, 6, 4, 5
IF ( I == 6 )
RETURN()
ENDIF
//
GotoWindow( 2 )
HWindow() // 1, 2, 7, 3, 6, 4, 5
IF ( I == 7 )
RETURN()
ENDIF
//
GotoWindow( 7 )
HWindow() // 1, 2, 7, 8, 3, 6, 4, 5
IF ( I == 8 )
RETURN()
ENDIF
//
GotoWindow( 2 )
HWindow() // 1, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 9 )
RETURN()
ENDIF
//
GotoWindow( 1 )
HWindow() // 1, 10, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 10 )
RETURN()
ENDIF
//
GotoWindow( 10 )
HWindow() // 1, 10, 11, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 11 )
RETURN()
ENDIF
//
GotoWindow( 11 )
HWindow() // 1, 10, 11, 12, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 12 )
RETURN()
ENDIF
//
GotoWindow( 10 )
HWindow() // 1, 10, 13, 11, 12, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 13 )
RETURN()
ENDIF
//
GotoWindow( 1 )
HWindow() // 1, 14, 10, 13, 11, 12, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 14 )
RETURN()
ENDIF
//
GotoWindow( 14 )
HWindow() // 1, 14, 15, 10, 13, 11, 12, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 15 )
RETURN()
ENDIF
//
GotoWindow( 1 )
HWindow() // 1, 16, 14, 15, 10, 13, 11, 12, 2, 9, 7, 8, 3, 6, 4, 5
IF ( I == 16 )
RETURN()
ENDIF
//
Warn( "I", ":", " ", "split window horizontally: unhandled value. Maximum is 16. Please check." )
//
RETURN()
//
END
INTEGER PROC FNWindowSetSplitSizeHorizontalExistEqualB( INTEGER maxI, INTEGER maxWidthI, INTEGER maxHeigthI )
INTEGER B = FALSE
//
INTEGER minI = 1
INTEGER I = 0
//
PushPosition()
PushBlock()
//
FOR I = minI TO maxI
//
//
CASE I
//
WHEN 1
//
// do nothing
//
WHEN 2
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 3
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 4
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 5
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 6
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 7
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 8
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 9
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 10
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 10 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 11
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 10 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 11 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 12
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 10 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 11 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 12 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 13
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 10 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 13 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 11 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 12 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 14
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 14 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 10 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 13 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 11 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 12 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 15 // the last window to the right is smaller. No root cause found yet for this issue [kn, ri, fr, 14-05-2021 12:25:05]
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 14 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 15 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 10 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 13 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 11 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 12 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
WHEN 16
//
GotoWindow( 1 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 16 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 14 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 15 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 10 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 13 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 11 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 12 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 2 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 9 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 7 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 8 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 3 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 6 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 4 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
GotoWindow( 5 )
SetWindowWidth( maxWidthI )
SetWindowHeight( maxHeigthI / maxI )
//
OTHERWISE
//
Warn( "FNWindowSetSplitSizeHorizontalEqualB(", " ", "case", " ", ":", " ", I, ": not known" )
//
B = FALSE
//
RETURN( B )
//
ENDCASE
//
ENDFOR
//
PopBlock()
PopPosition()
//
B = TRUE
//
RETURN( B )
//
END