GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Separator.H
Go to the documentation of this file.
1 /* Copyright 2000-2013 Matt Flax <flatmax@flatmax.org>
2  This file is part of GTK+ IOStream class set
3 
4  GTK+ IOStream is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  GTK+ IOStream is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You have received a copy of the GNU General Public License
15  along with GTK+ IOStream
16  */
17 #ifndef SEPARATOR_H_
18 #define SEPARATOR_H_
19 
20 #include <iomanip>
21 #include <gtk/gtk.h>
22 #include <mffm/LinkList.H>
23 
24 class Separator : public LinkList<GtkWidget *> {
25 public:
26  ~Separator(void){
27  GtkWidget *temp;
28  while (getCount()){
29  temp=remove();
30  gtk_widget_unref(temp);
31  }
32  }
33 };
34 
35 class VSeparator : public Separator {
36 public:
37  VSeparator(void){
38  vSepAlloc(1);
39  }
40 
42  vSepAlloc(count);
43  }
44 
45  void vSepAlloc(int count){
46  for (int i=0;i<count;i++){
47  add(gtk_vseparator_new());
48  gtk_widget_ref(current());
49  gtk_widget_show(current());
50  }
51  }
52 };
53 
54 class HSeparator : public Separator {
55 public:
56  HSeparator(void){
57  hSepAlloc(1);
58  }
59 
61  hSepAlloc(count);
62  }
63 
64  void hSepAlloc(int count){
65  for (int i=0;i<count;i++){
66  add(gtk_hseparator_new());
67  gtk_widget_ref(current());
68  gtk_widget_show(current());
69  }
70  }
71 };
72 #endif //SEPARATOR_H_