IUP

 view release on metacpan or  search on metacpan

lib/IUP/Manual/02_Elements.pod  view on Meta::CPAN


The new child can NOT be mapped. It will NOT map the new child into the
native system. If the parent is already mapped you must explicitly call
L<Map|/"Map()">, for the appended child.

If the actual parent is a layout box (L<IUP::Vbox|IUP::Vbox>, L<IUP::Hbox|IUP::Hbox>
or L<IUP::Zbox|IUP::Zbox>) and you try to append a child that it is already at the
parent child list, then the child is moved to the last child position.

The elements are NOT immediately repositioned. Call L<Refresh|/"Refresh()"> for
the container (or any other element in the dialog) to update the dialog
layout.

B<See Also:>
L<Detach|/"Detach()">,
L<Insert|/"Insert()">,
L<Map|/"Map()">,
L<Unmap|/"Unmap()">,
L<Refresh|/"Refresh()">,
L<IUP::Hbox|IUP::Hbox>,
L<IUP::Vbox|IUP::Vbox>,
L<IUP::Zbox|IUP::Zbox>,
L<IUP::Menu|IUP::Menu>.

=back

=head3 ConvertXYToPos()

=over

Converts a (x,y) coordinate in an item position.

 my $position = $element->ConvertXYToPos($x, $y);

B<$ih:> Identifier of the element.

B<$x:> X coordinate of the left corner of the interface element.

B<$y:> Y coordinate of the upper part of the interface element.

B<Returns:> the position starting at 0 (except for L<IUP::List|IUP::List> that starts
at 1). If fails returns -1.

B<Notes:>

It can be used for L<IUP::Text|IUP::Text> (returns a position in the string),
L<IUP::List|IUP::List> (returns an item) or L<IUP::Tree|IUP::Tree> (returns a node identifier).

B<See Also:>
L<IUP::Text|IUP::Text>,
L<IUP::List|IUP::List>,
L<IUP::Tree|IUP::Tree>.

=back

=head3 Destroy()

=over

Destroys an interface element and all its children. Only dialogs,
timers, popup menus and images should be normally destroyed, but
B<detached> controls can also be destroyed.

 $element->Destroy();

B<Notes:>

It will automatically B<unmap> and B<detach> the element if necessary,
and then B<destroy> the element.

This function also deletes the main names associated to the interface
element being destroyed, but if it has more than one name then some
names may be left behind.

B<Menu> bars associated with dialogs are automatically destroyed when
the dialog is destroyed.

B<Images> associated with controls are NOT automatically destroyed,
because images can be reused in several controls the application must
destroy them when they are not used anymore.

All dialogs and all elements that have names are automatically
destroyed in L<Close|IUP/"Close()">.

B<See Also:>
L<Append|/"Append()">,
L<Detach|/"Detach()">,
L<Map|/"Map()">,
L<Unmap|/"Unmap()">,
L<Create|/"Create()">.

=back

=head3 Detach()

=over

B<Detaches> an interface element from its parent.

 $element->Detach();

B<Notes:>

It will automatically call L<Unmap|/"Unmap()"> to B<unmap> the element if
necessary, and then B<detach> the element.

If left B<detached> it is still necessary to call L<Destroy|/"Destroy()"> to B<destroy> the IUP element.

The elements are NOT immediately repositioned. Call L<Refresh|/"Refresh()"> for
the container (or any other element in the dialog) to update the dialog
layout.

When the element is mapped some attributes are stored only in the
native system. If the element is B<unmaped> those attributes are lost.
Use the function L<SaveClassAttributes|/"SaveClassAttributes()">
when you want to B<unmap> the element and keep its attributes.

B<See Also:>
L<Append|/"Append()">,
L<Insert|/"Insert()">,
L<Refresh|/"Refresh()">,

lib/IUP/Manual/02_Elements.pod  view on Meta::CPAN


=head3 UpdateChildren()

=over

Mark the element to be redraw when the control returns to the system.

 $element->Update;

=back

=head3 UpdateChildren()

=over

Mark the element or its children to be redraw when the control returns
to the system.

 $element->UpdateChildren;

=back

=head3 Hide()

=over

Hides an interface element. This function has the same effect as
attributing value "NO" to the interface element's VISIBLE
attribute.

 $element->Hide();

B<Returns:> IUP_NOERROR always.

B<Notes:>

Once a dialog is hidden, either by means of L<Hide|/"Hide()"> method or by changing
the VISIBLE attribute or by means of a click in the window close
button, the elements inside this dialog are not destroyed, so that you
can show them again. To destroy dialogs, the L<Destroy|/"Destroy()"> method
must be called.

B<See Also:>
L<ShowXY|/"ShowXY()">,
L<Show|/"Show()">,
L<Popup|/"Popup()">,
L<Destroy|/"Destroy()">.
 
=back

=head3 Popup()

=over

Shows a dialog or menu and restricts user interaction only to the
specified element. It is equivalent of creating a Modal dialog is some
tooklits.

If another dialog is shown after L<Popup|/"Popup()"> using L<Show|/"Show()">, then its
interaction will not be inhibited. Every L<Popup|/"Popup()"> call creates a new
popup level that inhibits all previous dialogs interactions, but does
not disable new ones. IMPORTANT: The popup levels must be closed in the
reverse order they were created or unpredictable results will occur.

For a dialog this function will only return the control to the
application after a callback returns IUP_CLOSE, L<ExitLoop|IUP/"ExitLoop()"> is
called, or when the popup dialog is hidden, for exemple using
L<Hide|/"Hide()">. For a menu it returns automatically after a menu item is
selected. IMPORTANT: If a menu item callback returns IUP_CLOSE, it will
ends the current popup level dialog.

 $dialog->Popup($x, $y);
 #or
 $dialog->Popup();

B<$ih:> Identifier of a dialog or a menu.

B<$x>: horizontal position of the dialog or menu relative to the origin
of the main screen. The following constants (see L<IUP::Constants|IUP::Constants>)
are valid:

=over

=item * IUP_LEFT: Positions the element on the left corner of the
screen

=item * IUP_CENTER: Centers the element on the screen

=item * IUP_RIGHT: Positions the element on the right corner of the
screen

=item * IUP_MOUSEPOS: Positions the element on the mouse cursor

=item * IUP_CENTERPARENT: Horizontally centralizes the dialog relative
to its parent. Not valid for menus.

=item * IUP_CURRENT: use the current position of the dialog. This is
the B<default value> if the parameter is not defined. Not valid for
menus.

=back

B<$y:> vertical position of the dialog or menu relative to the origin of
the main screen. The following constants (see L<IUP::Constants|IUP::Constants>)
are valid:

=over

=item * IUP_TOP: Positions the element on the top of the screen

=item * IUP_CENTER: Vertically centers the element on the screen

=item * IUP_BOTTOM: Positions the element on the base of the screen

=item * IUP_MOUSEPOS: Positions the element on the mouse cursor

=item * IUP_CENTERPARENT: Vertically centralizes the dialog relative to
its parent. Not valid for menus.

=item * IUP_CURRENT: use the current position of the dialog. This is
the B<default value> if the parameter is not defined. Not valid for
menus.

=back

B<Returns:> IUP_NOERROR if sucessful. Returns IUP_INVALID if not a dialog
or menu. If there was an error returns IUP_ERROR.

B<Notes:>



( run in 1.489 second using v1.01-cache-2.11-cpan-364913b4093 )