Добрый день, разбираюсь с msegui возник вопрос:
Как создать фрейм, и как добавить его в форму?
Потыкался так и не понял)
Ну и еще вопрос - аналог Align:AlClient не появился?
Модератор: Модераторы
rellai2 писал(а):Ну и еще вопрос - аналог Align:AlClient не появился?
было
[____][____][____]
стало
[________][________][________]
А можно ли каким либо образом сделать так чтобы при растягивании формы например 3 кнопки, расположенные на одном уровне тоже растягивались, но не наезжали друг на друга? грубо говоря:
и еще вопрос, как сделать так чтобы форма хватала цвета системные, где то читал давно, но забыл ))
Да, еще как можно - используйте TLayouter.
Кажется, это делается ручками в коде, при запуске программы.
===================================================================
tlayouter
* a tspacer descendant designed to (auto)resize or/and move
its contained widgets acc to some size/positon dependencies
* may have GUI look, frame caption etc switched off by default
* layouters may be nested to achieve copmplex layouts
Each layout change/assignment is divided into performing 2 consequent stages :
Stage 1:
- if {lao_placex OR lao_placey} :
= if {plo_scalesize in optionslayout} then
* widgets with "osk_nopropwith" unset in their "optionsskin" are h-scaled
in the proportion of change of tlayouter's clientwidth
* widgets with "osk_nopropheight" unset in their "optionsskin" are v-scaled
in the proportion of change of tlayouter's clientheight
For h-resized layouter, the effect looks like :
|--Widget__1---Widget__2--| => the initial look
|--Widget_1--Widget_2--| => the layouter gets narrower
|---Widget___1---Widget___2---| => the layouter gets wider
*** both widget sizes & margins are affected ***
*** Widget_N may generally situate on different y-levels ***
otherwise :
= if lao_scalewidth in optionslayout :
* widgets with "osk_nopropwith" unset in their "optionsskin" enters in the mode
( not applied until the layouter resizes! ) when they are h-scaled in the proportion
as far as clientwidth of the tlayouter changes, then stages 2 & 3 are reapplied
For h-resized layouter, the effect looks like :
|--Single____widget????| => the initial look
|--Single__widget???| => the layouter gets narrower
|--Single_______widget?????| => the layouter gets wider
* also, if {lao_scaleleft in optionslayout} then left margins of the widgets
with unset "optionsskin.osk_nopropleft" resize too otherwise retain
= if lao_scaleheight in optionslayout :
* widgets with "osk_nopropheight" unset in their "optionsskin" enters in the mode
( not applied until the layouter resizes! ) when they are v-scaled in the proportion
as far as clientheight of the tlayouter changes, then stages 2 & 3 are reapplied
* also, if {lao_scaletop in optionslayout} then top margins of the widgets
with unset "optionsskin.osk_noproptop" resize too otherwise retain
*** only widget sizes & margins not distances between them are affected ***
Stage 2:
Widgets may be auto resized against themselves not the layouter
in 5 consequent steps using the following options:
- if plo_syncmaxautosize in place_options :
= all widgets are autosized then their client areas are
syncronized to the clientareas of the highest and the widest of the widget
* calls "msegui.syncmaxautosize"
- if plo_syncpaintwidth in place_options :
= the paintwidths of all widgets are synchronized to the widget
with the widest outer frame width ( ex. width of "frame.caption" )
* mainly makes sense if "lao_alignx" set and {align_glue = wam_start or wam_end} ( see below )
when the widgets will be adjusted in order to fit into
the inner client width of tlayouter:
x-aligh level
V
| Widget_1 the_widest_frame_caption1|
| Widget_2 norm_frame_caption2 |
| Widget_N wider_frame_captionN |
here, the effect is shown for "cp_right" frame captions
// otherwise syncronizes to the outer ( of the frame except its caption ) width
// of the Z-top widget
* calls "msegui.syncpaintwidth"
* paintwidth is the outer width
- if plo_syncpaintheight in place_options :
= the paintheights of all widgets are synchronized to the widget
with the highest outer frame width ( ex. width of "frame.caption" ).
* mainly makes sense if lao_aligny set and {align_glue = wam_start or wam_end} ( see below )
the widgets will be adjusted in order to fit into
the inner client height of tlayouter :
+------------------------------+
| The_ |
| tallest_ taller_ |
| frame_ frame_ frame_ |
| caption caption2 captionN |
| |
| Widget1 Widget_2 Widget_N |<== y-align level
here, the effect is shown for "cp_topleft" frame captions
// otherwise syncronizes to the outer ( of the frame except its caption )
// height of the Z-top widget
* calls "msegui.syncpaintheight"
- plo_synccaptiondistx in place_options :
= causes all widgets to have the widest common room for their cp_(left/right)* frame captions
* calls "msegui.synccaptiondistx"
- plo_synccaptiondisty in place_options :
= causes all widgets to have the highest common room for their cp_(top/bottom)* frame captions
* calls "msegui.synccaptiondisty"
Stage 3:
the widgets may be (re)arranged/sized against the layouter & between the widgets :
There're 2 modes of such (re)arrangement which can be partially ( orthogonally ) combined ( see later ):
1) the place(ment) mode ( lao_place* in optionslayout ) :
- widgets are placed at some distances between each other, possibly with some margins,
rooms of invisible widgets ( having visible=false) are also allocated
unless "plo_noinvisible in place_options"
* the widgets are placed in the order of decreasing their "widgetrect.x/y" coordinates before alignment
* the inter-widget distances and the side margins ( if apllied ) in both dimentions
are identical and limited between "place_mindist" and "place_maxdist"
= if {lao_placex in optionslayout} and
{place_mode <> wam_none}
then the following relevant settings aplly :
* non-limiting value of "place_maxdist" :
# |Widget_1------Widget_2------Widget_3|
* non-limiting value of "place_maxdist" and
{plo_propmargin in place_options} :
# |---Widget_1---Widget_2---Widget_3---|
* limiting value of "place_maxdist" and
{place_mode = wam_start} :
# |Widget_1----Widget_2----Widget_3????|
* limiting value of "place_maxdist" and
{place_mode = wam_start} and
{plo_propmargin in place_options} :
# |---Widget_1---Widget_2---Widget_3???|
* limiting value of "place_maxdist" and
{place_mode = wam_end} :
# |??????Widget_1---Widget_2---Widget_3|
* limiting value of "place_maxdist" and
{place_mode = wam_end} and
{plo_propmargin in place_options} :
# |???Widget_1---Widget_2---Widget_3---|
* limiting value of "place_maxdist" and
{place_mode = wam_center} :
# |???Widget_1---Widget_2---Widget_3???|
* limiting value of "place_maxdist" and
{plo_endmargin in place_options} :
# |Widget_1----Widget_2----Widget_____3|,
or
# |Widget_1----Widget_____2----Widget_3|,
or
# |Widget_____1----Widget_2----Widget_3|,
here, the most left amongst widgets having both [an_left,an_right] set is expanded
otherwise the most right widget ( Widget_3 in the example )
* limiting value of "place_maxdist" and
{place_mode = wam_end} and
{plo_propmargin in place_options} and
{plo_endmargin in place_options} :
# |--Widget_1--Widget_____2--Widget_3--|,
The legend:
limiting value
of "place_maxdist" : such value which produce
some visuall effect on the layouter
"----" : distance ( = number of minuses, limited by place_maxdis )
"????" : some remaining space ( = number of questmarks )
"Widget_1" : widget of the original size
"Widget__..__1" : (auto)resized widget
= if {lao_placey in optionslayout} and
{place_mode <> wam_none}
then the things are handled in the same manner as with "lao_placex"
but for the vertical "top2bottom" direction of placement instead of
the horizontal "left2right" one
2) the align(ment) mode ( optionslayout.lao_align* ) :
- widgets are gathered into a visual group to a dedicated "leader" widget of the layout
( set by "align_leader" and defaults to the lowest in Z-Order = twidget.widgets[0] )
the leader stays in place while the others :
= if lao_alignx in optionslayout ( the hor alignment mode ):
* if align_mode = wam_start : snap their left borders to the left border of leader
* else if align_mode = wam_end : snap their right borders to the right border of leader
* else if align_mode = wam_center : snap their v-axes to the v-axis of leader
after that,
= if lao_aligny in optionslayout ( the vert alignment mode ):
* if align_mode = wam_start : snap their top borders to the top border of leader
* else if align_mode = wam_end : snap their bottom borders to the bottom border of leader
* else if align_mode = wam_center : snap their h-axes to the h-axis of leader
- after that, the whole widget group can be aligned within the layouter:
= if align_glue = wam_start
* if lao_alignx in optionslayout:
# the left extent of group snaps to the left border of layouter
# if {plo_synpaintwidth in place_option} then the widgets of group may be h-squeezed so that not to extrude beyond the layouter
( as if they have both left & right anchors unset )
* if lao_aligny in optionslayout:
# the top extent of group snaps to the top border of layouter
# if {plo_synpaintheight in place_option} then the widgets of group may be v-squeezed so that not to extrude beyond the layouter
( as if they have both top & bottom anchors unset )
= else if align_glue = wam_end
* if lao_alignx in optionslayout:
# the right extent of group snaps to the right border of layouter
# if {plo_synpaintwidth in place_option} then the widgets of group may ne h-squeezed so that not to extrude beyond the layouter
( as if they have both left & right anchors unset )
* if lao_aligny in optionslayout:
# the bottom extent of group snaps to the bottom border of layouter
# if {plo_synpaintheight in place_option} then the widgets of group may be v-squeezed so that not to extrude beyond the layouter
( as if they have both top & bottom anchors unset )
= else if align_glue = wam_center
* if lao_alignx in optionslayout: the v-axis of group snaps to the v-axis of layouter
* if lao_aligny in optionslayout: the h-axis of group snaps to the h-axis of layouter
Mutually exclusive settings:
* only one of "align_mode" can be choosen
* only one of "glue_mode" can be choosen
* "optionslayout.lao_alignx" & "optionslayout.lao_placex"
* "optionslayout.lao_aligny" & "optionslayout.lao_placey"
V-alignment ( optionslayout.lao_aligny ) may be combined
with h-placement ( optionslayout.lao_placex ), and
h-alignment ( optionslayout.lao_alignx ) may be combined
with v-placement ( optionslayout.lao_placey )
!!! The effects of the above described { resizing / placement / alignment } are irreversible.
So, the only way to revert is to set "wan_none" then to revert manually !!!
было
[____][____][____]
стало
[________][________][________]
тоже пример не найдется?))))
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 4