source: trunk/design/ui/source/ui-widgets-spin_boxes.ads@ 5633

Last change on this file since 5633 was 5633, checked in by vadim.godunko, 4 years ago

Add signals and slots for Abstract_Spin_Box.

  • Property svn:keywords set to Author Date Revision
File size: 5.0 KB
Line 
1------------------------------------------------------------------------------
2-- --
3-- Matreshka Project --
4-- --
5-- Web Framework --
6-- --
7-- Runtime Library Component --
8-- --
9------------------------------------------------------------------------------
10-- --
11-- Copyright © 2016, Vadim Godunko <vgodunko@gmail.com> --
12-- All rights reserved. --
13-- --
14-- Redistribution and use in source and binary forms, with or without --
15-- modification, are permitted provided that the following conditions --
16-- are met: --
17-- --
18-- * Redistributions of source code must retain the above copyright --
19-- notice, this list of conditions and the following disclaimer. --
20-- --
21-- * Redistributions in binary form must reproduce the above copyright --
22-- notice, this list of conditions and the following disclaimer in the --
23-- documentation and/or other materials provided with the distribution. --
24-- --
25-- * Neither the name of the Vadim Godunko, IE nor the names of its --
26-- contributors may be used to endorse or promote products derived from --
27-- this software without specific prior written permission. --
28-- --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
40-- --
41------------------------------------------------------------------------------
42-- $Revision: 5633 $ $Date: 2016-09-29 12:44:02 +0000 (Thu, 29 Sep 2016) $
43------------------------------------------------------------------------------
44with Core.Connectables.Slots;
45private with Core.Connectables.Slots.Generic_Slots;
46private with Core.Connectables.Slots.Signals;
47
48package UI.Widgets.Spin_Boxes is
49
50 type Abstract_Spin_Box is abstract new Abstract_Widget with private;
51
52 not overriding function Editing_Finished_Signal
53 (Self : in out Abstract_Spin_Box)
54 return not null access Core.Connectables.Slots.Connection_Manager'Class;
55
56 not overriding procedure Step_Down
57 (Self : in out Abstract_Spin_Box) is abstract;
58
59 function Step_Down_Slot
60 (Self : in out Abstract_Spin_Box'Class)
61 return Core.Connectables.Slots.Slot'Class;
62
63 not overriding procedure Step_Up
64 (Self : in out Abstract_Spin_Box) is abstract;
65
66 function Step_Up_Slot
67 (Self : in out Abstract_Spin_Box'Class)
68 return Core.Connectables.Slots.Slot'Class;
69
70 package Constructors is
71
72 procedure Initialize
73 (Self : in out Abstract_Spin_Box'Class;
74 Element : not null WebAPI.HTML.Elements.HTML_Element_Access);
75
76 end Constructors;
77
78private
79
80 type Abstract_Spin_Box is abstract new Abstract_Widget with record
81 Editing_Finished : aliased Core.Connectables.Slots.Signals.Signal
82 (Abstract_Spin_Box'Unchecked_Access);
83 end record;
84
85 package Step_Down_Slots is
86 new Core.Connectables.Slots.Generic_Slots (Abstract_Spin_Box, Step_Down);
87
88 function Step_Down_Slot
89 (Self : in out Abstract_Spin_Box'Class)
90 return Core.Connectables.Slots.Slot'Class
91 renames Step_Down_Slots.To_Slot;
92
93 package Step_Up_Slots is
94 new Core.Connectables.Slots.Generic_Slots (Abstract_Spin_Box, Step_Up);
95
96 function Step_Up_Slot
97 (Self : in out Abstract_Spin_Box'Class)
98 return Core.Connectables.Slots.Slot'Class
99 renames Step_Down_Slots.To_Slot;
100
101end UI.Widgets.Spin_Boxes;
Note: See TracBrowser for help on using the repository browser.