Skip to content

Commit

Permalink
:separator
Browse files Browse the repository at this point in the history
  • Loading branch information
sanko committed Aug 22, 2023
1 parent f07c83d commit b4769dc
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,25 @@ value.

Creates a new progress bar.

## Separator Functions

A separator is a control to visually separate controls, horizontally or
vertically.

Import these functions with the `:separator` tag.

### `uiNewHorizontalSeparator( )`

my $hsplit = uiNewHorizontalSeparator( );

Creates a new horizontal separator.

### `uiNewVerticalSeparator( )`

my $hsplit = uiNewVerticalSeparator( );

Creates a new vertical separator.

# Requirements

[Affix](https://metacpan.org/pod/Affix) and [Alien::libui](https://metacpan.org/pod/Alien%3A%3Alibui)
Expand Down
46 changes: 39 additions & 7 deletions lib/LibUI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ package LibUI 1.00 {
'uiSliderOnChangeduiSlider', 'uiSliderOnReleased',
'uiSliderSetRange', 'uiNewSlider'
],
progressbar => [ 'uiProgressBarValue', 'uiProgressBarSetValue', 'uiNewProgressBar' ]
progressbar => [ 'uiProgressBarValue', 'uiProgressBarSetValue', 'uiNewProgressBar' ],
separator => [ 'uiNewHorizontalSeparator', 'uiNewVerticalSeparator' ]
);
{
my %seen;
push @{ $EXPORT_TAGS{control} }, grep { !$seen{$_}++ } @{ $EXPORT_TAGS{$_} }
for 'window', 'button', 'box', 'checkbox', 'entry', 'label', 'tab', 'group', 'spinbox',
'slider', 'progressbar';
'slider', 'progressbar', 'separator';
}
{
my %seen;
Expand Down Expand Up @@ -1744,6 +1745,38 @@ Creates a new progress bar.

affix $lib, 'uiNewProgressBar', [] => Type ['LibUI::ProgressBar'];

=head2 Separator Functions
A separator is a control to visually separate controls, horizontally or
vertically.
Import these functions with the C<:separator> tag.
=cut

typedef 'LibUI::HSeparator' => Type ['LibUI::Control'];
typedef 'LibUI::VSeparator' => Type ['LibUI::Control'];

=head3 C<uiNewHorizontalSeparator( )>
my $hsplit = uiNewHorizontalSeparator( );
Creates a new horizontal separator.
=cut

affix $lib, 'uiNewHorizontalSeparator', [] => Type ['LibUI::HSeparator'];

=head3 C<uiNewVerticalSeparator( )>
my $hsplit = uiNewVerticalSeparator( );
Creates a new vertical separator.
=cut

affix $lib, 'uiNewVerticalSeparator', [] => Type ['LibUI::VSeparator'];

#
typedef 'LibUI::Menu' => Type ['LibUI::Control'];
typedef 'LibUI::MenuItem' => Type ['LibUI::Control'];
Expand Down Expand Up @@ -1902,11 +1935,10 @@ Creates a new progress bar.
#~ :pointer],
#~ :void
#
affix $lib, 'uiNewDatePicker', [] => InstanceOf ['LibUI::DatePicker'];
affix $lib, 'uiNewTimePicker', [Str] => InstanceOf ['LibUI::TimePicker'];
affix $lib, 'uiNewDateTimePicker', [] => InstanceOf ['LibUI::DateTimePicker'];
affix $lib, 'uiNewFontButton', [] => InstanceOf ['LibUI::FontButton'];
affix $lib, 'uiNewHorizontalSeparator', [] => InstanceOf ['LibUI::Separator'];
affix $lib, 'uiNewDatePicker', [] => InstanceOf ['LibUI::DatePicker'];
affix $lib, 'uiNewTimePicker', [Str] => InstanceOf ['LibUI::TimePicker'];
affix $lib, 'uiNewDateTimePicker', [] => InstanceOf ['LibUI::DateTimePicker'];
affix $lib, 'uiNewFontButton', [] => InstanceOf ['LibUI::FontButton'];
#
affix $lib, 'uiMsgBox', [ InstanceOf ['LibUI::Window'], Str, Str ] => Void;
affix $lib, 'uiMsgBoxError', [ InstanceOf ['LibUI::Window'], Str, Str ] => Void;
Expand Down

0 comments on commit b4769dc

Please sign in to comment.