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

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

Rename Signal and Emitter types.

  • Property svn:keywords set to Author Date Revision
File size: 4.9 KB
Line 
1------------------------------------------------------------------------------
2-- --
3-- Matreshka Project --
4-- --
5-- Web Framework --
6-- --
7-- Runtime Library Component --
8-- --
9------------------------------------------------------------------------------
10-- --
11-- Copyright © 2016-2017, 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: 5698 $ $Date: 2017-01-20 12:52:10 +0000 (Fri, 20 Jan 2017) $
43------------------------------------------------------------------------------
44with Core.Slots_0;
45private with Core.Slots_0.Generic_Slots;
46private with Core.Slots_0.Emitters;
47
48package WUI.Widgets.Spin_Boxes is
49
50 type Abstract_Spin_Box is
51 abstract new WUI.Widgets.Abstract_Widget with private;
52
53 not overriding function Editing_Finished_Signal
54 (Self : in out Abstract_Spin_Box)
55 return not null access Core.Slots_0.Signal'Class;
56
57 not overriding procedure Step_Down
58 (Self : in out Abstract_Spin_Box) is abstract;
59
60 function Step_Down_Slot
61 (Self : in out Abstract_Spin_Box'Class)
62 return Core.Slots_0.Slot'Class;
63
64 not overriding procedure Step_Up
65 (Self : in out Abstract_Spin_Box) is abstract;
66
67 function Step_Up_Slot
68 (Self : in out Abstract_Spin_Box'Class)
69 return Core.Slots_0.Slot'Class;
70
71 package Constructors is
72
73 procedure Initialize
74 (Self : in out Abstract_Spin_Box'Class;
75 Element : not null WebAPI.HTML.Elements.HTML_Element_Access);
76
77 end Constructors;
78
79private
80
81 type Abstract_Spin_Box is
82 abstract new WUI.Widgets.Abstract_Widget with
83 record
84 Editing_Finished : aliased
85 Core.Slots_0.Emitters.Emitter (Abstract_Spin_Box'Unchecked_Access);
86 end record;
87
88 package Step_Down_Slots is
89 new Core.Slots_0.Generic_Slots (Abstract_Spin_Box, Step_Down);
90
91 function Step_Down_Slot
92 (Self : in out Abstract_Spin_Box'Class) return Core.Slots_0.Slot'Class
93 renames Step_Down_Slots.To_Slot;
94
95 package Step_Up_Slots is
96 new Core.Slots_0.Generic_Slots (Abstract_Spin_Box, Step_Up);
97
98 function Step_Up_Slot
99 (Self : in out Abstract_Spin_Box'Class) return Core.Slots_0.Slot'Class
100 renames Step_Down_Slots.To_Slot;
101
102end WUI.Widgets.Spin_Boxes;
Note: See TracBrowser for help on using the repository browser.