about_dialog.cc
Go to the documentation of this file.
1 /*
2  * Roboception GmbH
3  * Munich, Germany
4  * www.roboception.com
5  *
6  * Copyright (c) 2024 Roboception GmbH
7  * All rights reserved
8  *
9  * Author: Heiko Hirschmueller
10  */
11 
12 #include "about_dialog.h"
13 #include "layout.h"
14 
15 #include "resources/logo_128.xpm"
16 
17 #include <FL/Fl_Box.H>
18 #include <FL/Fl_Pixmap.H>
19 #include <FL/Fl_RGB_Image.H>
20 
21 #include <sstream>
22 
23 namespace
24 {
25 
26 void closeCb(Fl_Widget *, void *user_data)
27 {
28  AboutDialog *about=reinterpret_cast<AboutDialog *>(user_data);
29  about->hide();
30 }
31 
32 }
33 
35  Fl_Double_Window(600, 238, "About rcdiscover")
36 {
37  set_modal();
38 
39  int width=600-2*GAP_SIZE;
40 
41  Fl_Pixmap logo_xpm(logo_128_xpm);
42  Fl_RGB_Image logo_rgb(&logo_xpm, FL_GRAY);
43 
44  Fl_Box *box=new Fl_Box(ADD_RIGHT_XY, 100, 180);
45  box->box(FL_NO_BOX);
46  box->image(logo_rgb.copy(64, 64));
47 
48  out=new Fl_Multiline_Output(ADD_RIGHT_XY, width-110, 180);
49  out->labeltype(FL_NO_LABEL);
50  out->box(FL_NO_BOX);
51  out->textsize(static_cast<int>(1.2*out->textsize()));
52  out->clear_visible_focus();
53 
54  std::ostringstream msg;
55  msg << "Tool for the discovery of GigE Vision devices." << "\n";
56  msg << "\n";
57  msg << "Version: " << PACKAGE_VERSION << "\n";
58  msg << "\n";
59  msg << "Copyright (c) 2017-2023 Roboception GmbH\n";
60  msg << "The source code of rcdiscover is available\n";
61  msg << "under the 3-clause BSD license.\n";
62  msg << "\n";
63  msg << "This program is based on FLTK.\n";
64 
65  out->value(msg.str().c_str());
66 
67  close=new Button(ADD_BELOW_XY, width, 28, "Close");
68  close->callback(closeCb, this);
69 
70  checkGroupSize(__func__);
71  end();
72 
73  size_range(w(), h(), w(), h());
74 }
ADD_BELOW_XY
#define ADD_BELOW_XY
Definition: layout.h:121
AboutDialog::close
Button * close
Definition: about_dialog.h:30
Button
Definition: button.h:18
AboutDialog::out
Fl_Multiline_Output * out
Definition: about_dialog.h:29
ADD_RIGHT_XY
#define ADD_RIGHT_XY
Definition: layout.h:120
AboutDialog
Definition: about_dialog.h:21
GAP_SIZE
#define GAP_SIZE
Definition: layout.h:21
about_dialog.h
checkGroupSize
void checkGroupSize(const char *group_name)
The size of the current group must be set before adding all children, especially resizable ones.
Definition: layout.h:88
layout.h
AboutDialog::AboutDialog
AboutDialog()
Definition: about_dialog.cc:34


rcdiscover
Author(s): Heiko Hirschmueller , Raphael Schaller
autogenerated on Thu Aug 1 2024 02:55:56