Skip to content

Commit

Permalink
Fixed: detection of the minimum size of a child inside IupSplit.
Browse files Browse the repository at this point in the history
  • Loading branch information
scuri committed Nov 5, 2012
1 parent c13be80 commit 54140c2
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 215 deletions.
18 changes: 8 additions & 10 deletions html/en/elem/iupsplit.html
Expand Up @@ -71,8 +71,7 @@ <h3><a name="Attributes">Attributes</a></h3>
This will constrain the interactive change of the bar handler. Default:
&quot;0:1000&quot;. (Since 3.2)</p>
<p><strong>SHOWGRIP</strong> (<font SIZE="3">non inheritable</font>): Shows the
bar grip affordance. Default: YES. When set to NO, the BARSIZE is changed from 5
to 3.</p>
bar grip affordance. Default: YES. When set to NO, the BARSIZE is set to 3.</p>
<p><strong>VALUE</strong> (<font SIZE="3">non inheritable</font>): The proportion of the left or
top (child1) client area relative to the full available area. It is an
integer between 0 and 1000. If not defined or set to NULL, the Native size of
Expand All @@ -97,19 +96,18 @@ <h3><a name="Attributes">Attributes</a></h3>
also accepted.</p>

<h3>Notes</h3>
<p>The controls that you want to be resized must have the EXPAND=YES attribute set.
The control inside the split will not be resized with a size lesser than its
<strong>Natural</strong> size. See the <a href="../layout_guide.html">Layout Guide</a> for mode details
<p>The controls that you want to be resized must have the EXPAND=YES attribute
set. See the <a href="../layout_guide.html">Layout Guide</a> for mode details
on sizes.</p>
<p><strong>IupSplit</strong> is not capable of detecting a child minimum size,
so if a child has a minimum size, then manually set the <strong>MINMAX</strong>
attribute to avoid invalid positioning of the <strong>IupSplit</strong> bar.</p>
<p>If you set the MINMAX attribute for a direct child, <strong>IupSplit</strong>
will respect that size. Nested children will also have their size limits
respected.</p>
<p>The <strong>IupCanvas</strong> bar handler is always the first child of the
split. It can be obtained using <strong>IupGetChild</strong> or <strong>
IupGetNextChild</strong>.</p>
<p>The <strong>IupSplit</strong> control looks just like the <strong>IupSbox</strong>,
but internally is very different. While sbox controls only one element and can
push other elements outside the dialog, split balance its internal size and
but internally is very different. While the <strong>IupSbox </strong>controls only one element and can
push other elements outside the dialog, the <strong>IupSplit</strong> balance its internal size and
never push other elements outside its boundaries.</p>

<p>The container can be created with no elements and be dynamic filled using
Expand Down
4 changes: 3 additions & 1 deletion html/en/history3.html
Expand Up @@ -58,7 +58,7 @@ <h2 align="center">History of Changes in Version 3.x</h2>

</p>

<h3>CVS (23/Oct/2012)</h3>
<h3>CVS (05/Nov/2012)</h3>

<ul>

Expand All @@ -83,6 +83,8 @@ <h3>CVS (23/Oct/2012)</h3>
<li><span class="hist_fixed">Fixed:</span> the return value for POSX and
POSY in <strong>IupCanvas</strong> when the respective scrollbar is hidden
or disabled.</li>
<li><span class="hist_fixed">Fixed:</span> detection of the
minimum size of a child inside <strong>IupSplit</strong>.</li>

</ul>

Expand Down
2 changes: 0 additions & 2 deletions html/en/to_do.html
Expand Up @@ -44,8 +44,6 @@ <h4>For 3.7 (November 2012)</h4>
<li>New support for GTK 3</li>
<li>Fix better focus
control when changing the current tab in <strong>IupTabs</strong>.</li>
<li>Fix detection of the
minimum size of a child inside <strong>IupSplit</strong>.</li>
</ul>
<h4>Other Priorities</h4>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions src/iup_layout.c
Expand Up @@ -192,7 +192,7 @@ void iupLayoutCompute(Ihandle* ih)
iupBaseSetPosition(ih, 0, 0);
}

void iupLayoutSetMinMaxSize(Ihandle* ih, int *w, int *h)
void iupLayoutApplyMinMaxSize(Ihandle* ih, int *w, int *h)
{
if (ih->flags & IUP_MINSIZE)
{
Expand Down Expand Up @@ -261,7 +261,7 @@ void iupBaseComputeNaturalSize(Ihandle* ih)
}

/* crop the natural size */
iupLayoutSetMinMaxSize(ih, &(ih->naturalwidth), &(ih->naturalheight));
iupLayoutApplyMinMaxSize(ih, &(ih->naturalwidth), &(ih->naturalheight));
}

void iupBaseSetCurrentSize(Ihandle* ih, int w, int h, int shrink)
Expand Down Expand Up @@ -308,7 +308,7 @@ void iupBaseSetCurrentSize(Ihandle* ih, int w, int h, int shrink)

/* crop also the current size if expanded */
if (ih->expand & IUP_EXPAND_WIDTH || ih->expand & IUP_EXPAND_HEIGHT)
iupLayoutSetMinMaxSize(ih, &(ih->currentwidth), &(ih->currentheight));
iupLayoutApplyMinMaxSize(ih, &(ih->currentwidth), &(ih->currentheight));

if (ih->firstchild)
iupClassObjectSetChildrenCurrentSize(ih, shrink);
Expand Down
2 changes: 1 addition & 1 deletion src/iup_layout.h
Expand Up @@ -15,7 +15,7 @@ extern "C" {
void iupLayoutCompute(Ihandle* ih); /* can be called before map */
void iupLayoutUpdate(Ihandle* ih); /* called only after map */

void iupLayoutSetMinMaxSize(Ihandle* ih, int *w, int *h);
void iupLayoutApplyMinMaxSize(Ihandle* ih, int *w, int *h);

/* Other functions declared in <iup.h> and implemented here.
IupRefresh
Expand Down
2 changes: 1 addition & 1 deletion src/iup_sbox.c
Expand Up @@ -57,7 +57,7 @@ static void iSboxSaveDimension(Ihandle* ih, int w, int h)
{
ih->data->w = w;
ih->data->h = h;
iupLayoutSetMinMaxSize(ih, &(ih->data->w), &(ih->data->h));
iupLayoutApplyMinMaxSize(ih, &(ih->data->w), &(ih->data->h));
}

static void iSboxAddDecorOffset(Ihandle* ih, int *x, int *y)
Expand Down

0 comments on commit 54140c2

Please sign in to comment.