Novembre 2024 | Lun | Mar | Mer | Jeu | Ven | Sam | Dim |
---|
| | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | Calendrier |
|
|
| Zone client selon l'idée de Severin | |
| | |
Auteur | Message |
---|
Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Zone client selon l'idée de Severin Lun 28 Mai 2012 - 18:38 | |
| 1. Ich habe das Programm so angepasst, dass die Konstanten option_left_hide% und option_top_hide% als Matrize mit Dimension (max_client_area%) deklariert werden. So kann man für jede client area die Parameter getrennt wählen. Aber: diese Parameter steuern das "Verschwinden" der Objekte beim Annähern an den oberen oder linken Rand ! Es bedeutet NICHT, dass sie nicht gescrollt werden ! Welchen Sinn hätte das auch, wenn, wie in client area 3, der Trenner gar nicht sichtbar ist. Wenn er nicht vertikal gescrollt wird, kann er nie sichtbar werden. Das Kommando "gosub object_add" bestimmt, ob ein Objekt am Scrollprozess Teil nimmt oder nicht. Man kann allerding die Variablen n_obj%(...) und tab_obj%(...) duplizieren zu n_hor_obj%(...) und tab_jor_obj%(...), die routine object_add duplizieren zu object_hor_add. Diese neue Routine muss dann diese neuen Variablen verwenden. Dann kann man die Routine scroll_vertical so belassen, wie sie ist, und die neue Routine scroll_horizontal wird geändert, um die neuen Variablen n_hor_obj% und tab_hor_obj% zu verwenden. Der Endeffeckt dieser Änderung ist, dass man für jedes Objekt einer client area beide oder nur eine der beiden xxx_add Routinen aufruft, je nach dem, welche Scrollrichtung für das Objekt zugelassen sein soll. Soll ich es Dir machen ? Hier ist die wie oben angegebene korrigierte Version: - Code:
-
' ****************************************************************************** ' area #1 separator scroll verikal and scroll horizontal ' area #2 separator scroll verikal and scroll no horizontal ' area #3 separator scroll no verikal and scroll horizontal ' area #4 separator scroll no verikal and scroll no horizontal ' ******************************************************************************
label labels gosub labels gosub constantes gosub variables gosub form0 gosub GUI ' gosub initialisations gosub main end ' labels: label constantes, variables, form0, GUI ' label initialisations label main label add_object label scroll_vertical label scroll_horizontal label add_client_area label area1, area2, area3, area4 return ' constantes: dim max_client_area% : max_client_area% = 4 dim max_height% dim max_width% ' put 1 into following option to hide objects disappearing to the left dim option_left_hide%(max_client_area%) dim option_top_hide%(max_client_area%) return ' variables: dim no%, n_client_area%, client_area%(max_client_area%) dim scroll_bar_vertical%(max_client_area%) dim scroll_bar_horizontal%(max_client_area%) dim no_name%, no_memo% dim scroll_pos%(max_client_area%), scroll_pos_horizontal%(max_client_area%) dim n_obj%(max_client_area%), tab_obj%(200,max_client_area%) dim i%, n%, x_client_area%, separator%(max_client_area%) return ' ****************************************************************************** form0: width 0,808 : height 0,800 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,10 : width no%,100 caption no%,"verti y / horiz y #1" : on_click no%,area1 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,120 : width no%,100 caption no%,"verti y / horiz n #2" : on_click no%,area2 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,240 : width no%,100 caption no%,"verti n / horiz y #3" : on_click no%,area3 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,360 : width no%,100 caption no%,"verti n / horiz n #4" : on_click no%,area4 return ' ****************************************************************************** GUI: ' variable for client area # 1 max_height% = 2000 max_width% = 2000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(1) = 0 option_top_hide%(1) = 0 ' client area # 1 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 1" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #1 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,0 : width no%,width(client_area%(n_client_area%))-20 top no%,580 : height no%,20 : caption no%,"Client area 1 Page 1" gosub add_object ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal ' ****************************************************************************** ' client area # 2 ' variable for client area # 2 max_height% = 3000 max_width% = 3000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(2) = 0 option_top_hide%(2) = 0 ' client area # 2 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 2" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #2 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,1 : width no%,width(client_area%(n_client_area%))-20 top no%,560 : height no%,20 : caption no%,"Client area 2 Page 1" gosub add_object ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal return ' ****************************************************************************** ' ****************************************************************************** ' client area # 3 ' variable for client area # 3 max_height% = 4000 max_width% = 4000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(3) = 0 option_top_hide%(3) = 0 ' client area # 3 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 3" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #3 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,1 : width no%,width(client_area%(n_client_area%))-20 top no%,560 : height no%,20 : caption no%,"Client area 3 Page 1" gosub add_object ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal ' ****************************************************************************** ' ****************************************************************************** ' client area # 4 ' variable for client area # 4 max_height% = 5000 max_width% = 5000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(4) = 0 option_top_hide%(4) = 0 ' client area # 4 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 4" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #4 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,1 : width no%,width(client_area%(n_client_area%))-20 top no%,560 : height no%,20 : caption no%,"Client area 4 Page 1" gosub add_object ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal return ' ****************************************************************************** add_object: n_obj%(n_client_area%) = n_obj%(n_client_area%) + 1 tab_obj%(n_obj%(n_client_area%),n_client_area%) = no% return ' ****************************************************************************** add_client_area: n_client_area% = n_client_area% + 1 client_area%(n_client_area%) = no% return ' ****************************************************************************** scroll_vertical: n% = number_change for i%=1 to n_client_area% if scroll_bar_vertical%(i%)=n% x_client_area% = i% exit_for end_if next i% n% = position(scroll_bar_vertical%(x_client_area%)) - scroll_pos%(x_client_area%) scroll_pos%(x_client_area%) = position(scroll_bar_vertical%(x_client_area%)) if x_client_area%<>1 caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) end_if for i%=1 to n_obj%(x_client_area%) top tab_obj%(i%,x_client_area%),top(tab_obj%(i%,x_client_area%)) - n% if option_top_hide%(x_client_area%)=1 if top(tab_obj%(i%,x_client_area%))<10 hide tab_obj%(i%,x_client_area%) else show tab_obj%(i%,x_client_area%) end_if end_if next i% return ' ****************************************************************************** scroll_horizontal: n% = number_change for i%=1 to n_client_area% if scroll_bar_horizontal%(i%)=n% x_client_area% = i% exit_for end_if next i% n% = position(scroll_bar_horizontal%(x_client_area%)) - scroll_pos_horizontal%(x_client_area%) scroll_pos_horizontal%(x_client_area%) = position(scroll_bar_horizontal%(x_client_area%)) for i%=1 to n_obj%(x_client_area%) left tab_obj%(i%,x_client_area%),left(tab_obj%(i%,x_client_area%)) - n% if option_left_hide%(x_client_area%)=1 if left(tab_obj%(i%,x_client_area%))<10 hide tab_obj%(i%,x_client_area%) else show tab_obj%(i%,x_client_area%) end_if end_if next i% return ' ****************************************************************************** area1: hide client_area%(x_client_area%) x_client_area% = 1 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' *** area2: hide client_area%(x_client_area%) x_client_area% = 2 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' *** area3: hide client_area%(x_client_area%) x_client_area% = 1 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' *** area4: hide client_area%(x_client_area%) x_client_area% = 2 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' ****************************************************************************** main: x_client_area% = 1 gosub area1 return | |
| | | Severin
Nombre de messages : 547 Localisation : Braunschweig / Germany Date d'inscription : 13/12/2010
| Sujet: Re: Zone client selon l'idée de Severin Lun 28 Mai 2012 - 20:18 | |
| @ Klaus danke für deine Antwort.
Folgende Idee steckt dahinter:
Die Bar sollen aber bleiben und die area soll beweglich bleiben.
' area #1 separator scroll verikal and scroll horizontal Das ist der normal Zustand.
Beispiel: Seperator grenzt die sichtbaren Seiten voneiander ab.
' area #2 separator scroll verikal and scroll no horizontal Der Seperator geht mit nach links. Der Seperator bleibt an seiner Position horizontal fixiert.
Beispiel: Kopfzeile für Grid 1. Das Grid 2 wird unter Grid 1 nach oben geschoben.
' area #3 separator scroll no verikal and scroll horizontal Der Seperator bleibt an seiner Position vertikal fixiert. Der Seperator geht mit nach oben.
Beispiel: Linke Spalte für Grid 1. Das Grid 2 wird unter Grid 1 nach links geschoben.
' area #4 separator scroll no verikal and scroll no horizontal Der Seperator bleibt an seiner Position vertikal fixiert. Der Seperator bleibt an seiner Position horizontal fixiert.
Beispiel: Eine Überschrift bleibt immer an der fixierten Position sichtbar.
Die Bar sollen aber bleiben und die area soll beweglich bleiben. Ich möche es nicht nur für Grid einsetzen, auch für andere Objekte.
Wenn Sie so freundlich sind, nehme ich ihr Angebot gern an. Severin | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Zone client selon l'idée de Severin Lun 28 Mai 2012 - 20:54 | |
| OK. Ich mache es heute Abend.
Freundliche Bemerkung: hier im Forum sind wir gewöhnlich aud DU. | |
| | | Severin
Nombre de messages : 547 Localisation : Braunschweig / Germany Date d'inscription : 13/12/2010
| Sujet: Re: Zone client selon l'idée de Severin Lun 28 Mai 2012 - 21:37 | |
| @ Klaus danke
Durch die google Übersetzung bin ich manchmal durcheinander. Soll jetzt Sie oder soll ich DU sagen.
Also bleibe ich jetzt für alle beim DU.
Es eilt nicht, ich gehe gleich wieder auf Dienstreise bis Freitag. Aber ich freue mich über deine Hilfe.
Ich hoffe ich habe mich deutlich ausgedrückt. Manchmal habe ich einfach zu viele Ideen, zur gleichen Zeit. Ein Wochenende ist einfach zu kurz.
Ich habe hier die Entwürfe für Regression, Grid zur Darstellung von Exceltabellen, und weiter diverse Dinge.
Erstaunlich das Jack keine Antwort gibt. Also warten.
Severin | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Zone client selon l'idée de Severin Lun 28 Mai 2012 - 22:00 | |
| Kurz zu den Formalitäten: wir fühlen uns alle freundschaftlich verbunden im gemeinsamen Interesse für Panoramic, un daher, so wie das auch in anderen Forums üblich ist, dutzen wir uns grundsätzlich gegenseitig. Nun zur Technik: Hier ist die Implementierung dessen, was ich oben angedeutet habe. Ich denke, dass es Deinen Vorstellungen entspricht. - Code:
-
' ****************************************************************************** ' area #1 separator scroll verikal and scroll horizontal ' area #2 separator scroll verikal and scroll no horizontal ' area #3 separator scroll no verikal and scroll horizontal ' area #4 separator scroll no verikal and scroll no horizontal ' ******************************************************************************
label labels gosub labels gosub constantes gosub variables gosub form0 gosub GUI ' gosub initialisations gosub main end ' labels: label constantes, variables, form0, GUI ' label initialisations label main label add_object, add_hor_object label scroll_vertical label scroll_horizontal label add_client_area label area1, area2, area3, area4 return ' constantes: dim max_client_area% : max_client_area% = 4 dim max_height% dim max_width% ' put 1 into following option to hide objects disappearing to the left dim option_left_hide%(max_client_area%) dim option_top_hide%(max_client_area%) return ' variables: dim no%, n_client_area%, client_area%(max_client_area%) dim scroll_bar_vertical%(max_client_area%) dim scroll_bar_horizontal%(max_client_area%) dim no_name%, no_memo% dim scroll_pos%(max_client_area%), scroll_pos_horizontal%(max_client_area%) dim n_obj%(max_client_area%), tab_obj%(200,max_client_area%) dim n_hor_obj%(max_client_area%), tab_hor_obj%(200,max_client_area%) dim i%, n%, x_client_area%, separator%(max_client_area%) return ' ****************************************************************************** form0: width 0,808 : height 0,800 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,10 : width no%,100 caption no%,"verti y / horiz y #1" : on_click no%,area1 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,120 : width no%,100 caption no%,"verti y / horiz n #2" : on_click no%,area2 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,240 : width no%,100 caption no%,"verti n / horiz y #3" : on_click no%,area3 ' *** no% = no% + 1 : button no% : top no%,10 : left no%,360 : width no%,100 caption no%,"verti n / horiz n #4" : on_click no%,area4 return ' ****************************************************************************** GUI: ' variable for client area # 1 max_height% = 2000 max_width% = 2000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(1) = 0 option_top_hide%(1) = 0 ' client area # 1 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 1" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #1 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,0 : width no%,width(client_area%(n_client_area%))-20 top no%,580 : height no%,20 : caption no%,"Client area 1 Page 1" gosub add_object : ' allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal ' ****************************************************************************** ' client area # 2 ' variable for client area # 2 max_height% = 3000 max_width% = 3000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(2) = 0 option_top_hide%(2) = 0 ' client area # 2 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 2" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #2 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,1 : width no%,width(client_area%(n_client_area%))-20 top no%,560 : height no%,20 : caption no%,"Client area 2 Page 1" gosub add_object : ' allow vertical scrolling ' gosub add_hor_object : ' do NOT allow horizontal scrolling ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal ' ****************************************************************************** ' ****************************************************************************** ' client area # 3 ' variable for client area # 3 max_height% = 4000 max_width% = 4000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(3) = 0 option_top_hide%(3) = 0 ' client area # 3 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 3" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #3 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,1 : width no%,width(client_area%(n_client_area%))-20 top no%,560 : height no%,20 : caption no%,"Client area 3 Page 1" ' gosub add_object : ' do NOT allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal ' ****************************************************************************** ' ****************************************************************************** ' client area # 4 ' variable for client area # 4 max_height% = 5000 max_width% = 5000 ' put 1 into following option to hide objects disappearing to the left option_left_hide%(4) = 0 option_top_hide%(4) = 0 ' client area # 4 initialize no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 4" width no%,800 : height no%,600 ' ****************************************************************************** ' Programm auf client area #4 no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,1 : width no%,width(client_area%(n_client_area%))-20 top no%,560 : height no%,20 : caption no%,"Client area 4 Page 1" ' gosub add_object : ' do NOT allow vertical scrolling ' gosub add_hor_object : ' do NOT allow horizontall scrolling ' ****************************************************************************** ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_vertical%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll_vertical ' this objekt must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal return ' ****************************************************************************** add_object: n_obj%(n_client_area%) = n_obj%(n_client_area%) + 1 tab_obj%(n_obj%(n_client_area%),n_client_area%) = no% return ' ****************************************************************************** add_hor_object: n_hor_obj%(n_client_area%) = n_hor_obj%(n_client_area%) + 1 tab_hor_obj%(n_hor_obj%(n_client_area%),n_client_area%) = no% return ' ****************************************************************************** add_client_area: n_client_area% = n_client_area% + 1 client_area%(n_client_area%) = no% return ' ****************************************************************************** scroll_vertical: n% = number_change for i%=1 to n_client_area% if scroll_bar_vertical%(i%)=n% x_client_area% = i% exit_for end_if next i% if n_obj%(x_client_area%)=0 then return n% = position(scroll_bar_vertical%(x_client_area%)) - scroll_pos%(x_client_area%) scroll_pos%(x_client_area%) = position(scroll_bar_vertical%(x_client_area%)) if x_client_area%<>1 caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) end_if for i%=1 to n_obj%(x_client_area%) top tab_obj%(i%,x_client_area%),top(tab_obj%(i%,x_client_area%)) - n% if option_top_hide%(x_client_area%)=1 if top(tab_obj%(i%,x_client_area%))<10 hide tab_obj%(i%,x_client_area%) else show tab_obj%(i%,x_client_area%) end_if end_if next i% return ' ****************************************************************************** scroll_horizontal: n% = number_change for i%=1 to n_client_area% if scroll_bar_horizontal%(i%)=n% x_client_area% = i% exit_for end_if next i% if n_hor_obj%(x_client_area%)=0 then return n% = position(scroll_bar_horizontal%(x_client_area%)) - scroll_pos_horizontal%(x_client_area%) scroll_pos_horizontal%(x_client_area%) = position(scroll_bar_horizontal%(x_client_area%)) for i%=1 to n_hor_obj%(x_client_area%) left tab_hor_obj%(i%,x_client_area%),left(tab_hor_obj%(i%,x_client_area%)) - n% if option_left_hide%(x_client_area%)=1 if left(tab_hor_obj%(i%,x_client_area%))<10 hide tab_hor_obj%(i%,x_client_area%) else show tab_hor_obj%(i%,x_client_area%) end_if end_if next i% return ' ****************************************************************************** area1: hide client_area%(x_client_area%) x_client_area% = 1 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' *** area2: hide client_area%(x_client_area%) x_client_area% = 2 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' *** area3: hide client_area%(x_client_area%) x_client_area% = 3 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' *** area4: hide client_area%(x_client_area%) x_client_area% = 4 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return ' ****************************************************************************** main: x_client_area% = 1 gosub area1 return Aber zögere nicht mit Lommentaren, Kritik un Besserungvorschlägen - so reift eine Software : | |
| | | Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: Zone client selon l'idée de Severin Mer 30 Mai 2012 - 22:36 | |
| @tous: Voici une version évoluée du logiciel "zone client" (client area) que j'ai implémlenté sur une idée de Severin. Voici les évolutions: - les constantes option_top_hide% et option_left_hide% sont devenues des tableaux avec une case par zone client. On peut ainsi piloter le comportement de "disparition" des objets lors d'un scrolling, séparément pour chaque zone client - la routine add_object était utilisée pour déclarer qu'un objet d'une zone client devait participer au scrolling fût-il horizontal ou vertical. Ce comportement a été scindé en deux routines distinctes. La routine add_object ne s'applique plus qu'au scrolling vertical, et la nouvelle routine add_hor_object prend en charge le scrolling horizontal. On peut ainsi définir, pour chaque objet, s'il doit pouvoir être scrollé, horizontalement, verticalement, les deux ou pas du tout, suivant le ou les sous-programmes appelés. Voici le code avec une démo: - Code:
-
label labels : gosub labels gosub constantes gosub variables gosub form0 gosub GUI gosub initialisations gosub main end
labels: label constantes, variables, form0, GUI, initialisations, main label add_object, add_hor_object, scroll, scroll_horizontal, add_client_area label area1, area2 return
constantes: dim max_client_area% : max_client_area% = 2 dim max_height% : max_height% = 2000 dim max_width% : max_width% = 2000 return
variables: dim no%, n_client_area%, client_area%(max_client_area%) dim scroll_bar%(max_client_area%), scroll_bar_horizontal%(max_client_area%) dim no_name%, no_memo% dim scroll_pos%(max_client_area%), scroll_pos_horizontal%(max_client_area%) dim n_obj%(max_client_area%), tab_obj%(200,max_client_area%) dim n_hor_obj%(max_client_area%), tab_hor_obj%(200,max_client_area%) dim i%, n%, x_client_area%, separator%(max_client_area%) ' put 1 into following the options to hide objects disappearing to the left dim option_left_hide%(max_client_area%) ' put 1 into following the options to hide objects disappearing at the top dim option_top_hide%(max_client_area%) return
form0: width 0,808 : height 0,800 no% = no% + 1 : button no% : top no%,10 : left no%,10 caption no%,"Client area 1" : on_click no%,area1 no% = no% + 1 : button no% : top no%,10 : left no%,110 caption no%,"Client area 2" : on_click no%,area2 return
GUI: ' client area # 1 no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 1" width no%,800 : height no%,600 option_top_hide%(n_client_area%) = 0 option_left_hide%(n_client_area%) = 0 no% = no% + 1 : alpha no% : parent no%,client_area%(n_client_area%) top no%,20 : left no%,20 caption no%,"Name:" gosub add_object : ' allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling no% = no% + 1 : edit no% : parent no%,client_area%(n_client_area%) no_name% = no% top no%,20 : left no%,60 gosub add_object : ' allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling no% = no% + 1 : memo no% : parent no%,client_area%(n_client_area%) no_memo% = no% : bar_vertical no% top no%,550 : left no%,20 : width no%,400 : height no%,200 gosub add_object : ' allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling no% = no% + 1 : alpha no% : parent no%,client_area%(n_client_area%) font_size no%,24 : font_color no%,255,0,0 top no%,200 : left no%,1000 font_bold no% : caption no%,"My special text" gosub add_object : ' allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,0 : width no%,width(client_area%(n_client_area%))-20 top no%,780 : height no%,20 : caption no%,"Client area 1 Page 1" gosub add_object : ' allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling ' these 2 objects must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% : scroll_bar%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal
' client area # 2 no% = no% + 1 : container no% : hide no% gosub add_client_area top no%,100 : left no%,0 : caption no%,"Client area 2" width no%,800 : height no%,600 option_top_hide%(n_client_area%) = 0 option_left_hide%(n_client_area%) = 0 no% = no% + 1 : alpha no% : parent no%,client_area%(n_client_area%) font_size no%,24 : font_color no%,255,0,0 top no%,200 : left no%,200 font_bold no% : caption no%,"Text for second client area" gosub add_object : ' allow vertical scrolling gosub add_hor_object : ' allow horizontal scrolling no% = no% + 1 : container no% : parent no%,client_area%(n_client_area%) separator%(n_client_area%) = no% left no%,1 : width no%,width(client_area%(n_client_area%))-20 top no%,560 : height no%,20 : caption no%,"Client area 2 Page 1" ' gosub add_object : ' allow vertical scrolling ' gosub add_hor_object : ' allow horizontal scrolling ' these 2 objects must be the LAST for the CONTAINER ! no% = no% + 1 : scroll_bar no% : scroll_bar%(n_client_area%) = no% parent no%,client_area%(n_client_area%) vertical no% : top no%,10 : left no%,780 : height no%,585 min no%,0 max no%, max_height% - height(client_area%(n_client_area%))-20 on_change no%,scroll no% = no% + 1 : scroll_bar no% scroll_bar_horizontal%(n_client_area%) = no% parent no%,client_area%(n_client_area%) horizontal no% : top no%,580 : left no%,10 : width no%,760 min no%,0 max no%, max_width% - width(client_area%(n_client_area%))-20 on_change no%,scroll_horizontal return
add_object: n_obj%(n_client_area%) = n_obj%(n_client_area%) + 1 tab_obj%(n_obj%(n_client_area%),n_client_area%) = no% return
add_hor_object: n_hor_obj%(n_client_area%) = n_hor_obj%(n_client_area%) + 1 tab_hor_obj%(n_hor_obj%(n_client_area%),n_client_area%) = no% return
add_client_area: n_client_area% = n_client_area% + 1 client_area%(n_client_area%) = no% return
initialisations: for i%=1 to (max_client_area%) scroll_pos%(i%) = 0 next i% for i%=1 to 50 item_add no_memo%,"Line "+str$(i%) next i% return
scroll: n% = number_change for i%=1 to n_client_area% if scroll_bar%(i%)=n% x_client_area% = i% exit_for end_if next i% n% = position(scroll_bar%(x_client_area%)) - scroll_pos%(x_client_area%) scroll_pos%(x_client_area%) = position(scroll_bar%(x_client_area%)) if x_client_area%<>1 caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) end_if for i%=1 to n_obj%(x_client_area%) top tab_obj%(i%,x_client_area%),top(tab_obj%(i%,x_client_area%)) - n% if option_top_hide%(x_client_area%)=1 if top(tab_obj%(i%,x_client_area%))<10 hide tab_obj%(i%,x_client_area%) else show tab_obj%(i%,x_client_area%) end_if end_if next i% return
scroll_horizontal: n% = number_change for i%=1 to n_client_area% if scroll_bar_horizontal%(i%)=n% x_client_area% = i% exit_for end_if next i% n% = position(scroll_bar_horizontal%(x_client_area%)) - scroll_pos_horizontal%(x_client_area%) scroll_pos_horizontal%(x_client_area%) = position(scroll_bar_horizontal%(x_client_area%)) for i%=1 to n_hor_obj%(x_client_area%) left tab_hor_obj%(i%,x_client_area%),left(tab_hor_obj%(i%,x_client_area%)) - n% if option_left_hide%(x_client_area%)=1 if left(tab_hor_obj%(i%,x_client_area%))<10 hide tab_hor_obj%(i%,x_client_area%) else show tab_hor_obj%(i%,x_client_area%) end_if end_if next i% return
area1: hide client_area%(x_client_area%) x_client_area% = 1 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return
area2: hide client_area%(x_client_area%) x_client_area% = 2 show client_area%(x_client_area%) caption separator%(x_client_area%),"Client area "+str$(x_client_area%)+" Page "+str$(int(scroll_pos%(x_client_area%)/560)+1) return
main: x_client_area% = 1 gosub area1 return
| |
| | | Contenu sponsorisé
| Sujet: Re: Zone client selon l'idée de Severin | |
| |
| | | | Zone client selon l'idée de Severin | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |