~ubuntu-branches/ubuntu/hardy/fltk1.1/hardy

« back to all changes in this revision

Viewing changes to test/browser.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2004-12-04 12:59:54 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041204125954-0bnefh426a67cjgl
Tags: 1.1.6-2
test/*.cxx: Apply patch from Andreas Jochens <aj@andaco.de> to fix
bogus pointer->int casts, which GCC 4.0 rightly treats as errors on
64-bit systems.  (Closes: #284168.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: browser.cxx,v 1.5.2.6.2.6 2004/04/11 04:39:00 easysw Exp $"
 
2
// "$Id: browser.cxx,v 1.5.2.6.2.7 2004/07/26 20:52:52 easysw Exp $"
3
3
//
4
4
// Browser test program for the Fast Light Tool Kit (FLTK).
5
5
//
74
74
Fl_Button       *top,
75
75
                *bottom,
76
76
                *middle,
77
 
                *visible;
 
77
                *visible,
 
78
                *swap;
78
79
Fl_Int_Input    *field;
79
80
 
80
81
void b_cb(Fl_Widget* o, void*) {
101
102
    browser->make_visible(line);
102
103
}
103
104
 
 
105
void swap_cb(Fl_Widget *o, void *) {
 
106
  int a = -1, b = -1;
 
107
  for ( int t=0; t<browser->size(); t++ ) {     // find two selected items
 
108
    if ( browser->selected(t) ) {
 
109
      if ( a < 0 )
 
110
        { a = t; }
 
111
      else 
 
112
        { b = t; break; }
 
113
    }
 
114
  }
 
115
  browser->swap(a, b);                          // swap them
 
116
}
 
117
 
104
118
int main(int argc, char **argv) {
105
119
  int i;
106
120
  if (!Fl::args(argc,argv,i)) Fl::fatal(Fl::help);
139
153
  field = new Fl_Int_Input(50, 350, 350, 25, "Line #:");
140
154
  field->callback(show_cb);
141
155
 
142
 
  top = new Fl_Button(0, 375, 100, 25, "Top");
 
156
  top = new Fl_Button(0, 375, 80, 25, "Top");
143
157
  top->callback(show_cb);
144
158
 
145
 
  bottom = new Fl_Button(100, 375, 100, 25, "Bottom");
 
159
  bottom = new Fl_Button(80, 375, 80, 25, "Bottom");
146
160
  bottom->callback(show_cb);
147
161
 
148
 
  middle = new Fl_Button(200, 375, 100, 25, "Middle");
 
162
  middle = new Fl_Button(160, 375, 80, 25, "Middle");
149
163
  middle->callback(show_cb);
150
164
 
151
 
  visible = new Fl_Button(300, 375, 100, 25, "Make Vis.");
 
165
  visible = new Fl_Button(240, 375, 80, 25, "Make Vis.");
152
166
  visible->callback(show_cb);
153
167
 
 
168
  swap = new Fl_Button(320, 375, 80, 25, "Swap");
 
169
  swap->callback(swap_cb);
 
170
  swap->tooltip("Swaps two selected lines\n(Use CTRL-click to select two lines)");
 
171
 
154
172
  window.resizable(browser);
155
173
  window.show(argc,argv);
156
174
  return Fl::run();
157
175
}
158
176
 
159
177
//
160
 
// End of "$Id: browser.cxx,v 1.5.2.6.2.6 2004/04/11 04:39:00 easysw Exp $".
 
178
// End of "$Id: browser.cxx,v 1.5.2.6.2.7 2004/07/26 20:52:52 easysw Exp $".
161
179
//
162
180