]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormCredits.C
Added FormCredits dialog (MVC version) by Michael Koziarski.
[lyx.git] / src / frontends / gnome / FormCredits.C
1 // -*- C++ -*-
2 /* This file is part of
3  * =================================================
4  * 
5  *          LyX, The Document Processor
6  *          Copyright 1995-2000 The LyX Team.
7  *
8  * ================================================= 
9  *
10  * \author Michael Koziarski <michael@koziarski.org>
11  */
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include <config.h>
18
19 #include "gnomeBC.h"
20 #include "FormCredits.h"
21
22 #include <gnome--/dialog.h>
23 #include <gtk--/button.h>
24 #include <gtk--/text.h>
25
26 FormCredits::FormCredits(ControlCredits & c)
27         : FormCB<ControlCredits>(c, "diahelpcredits.glade", "DiaHelpCredits")
28         , dialog_(0)
29 {
30
31 }
32
33
34 FormCredits::~FormCredits()
35 {
36         //dialog_->destroy();
37 }
38
39
40 void FormCredits::build()
41 {
42         dialog_ = dialog();
43
44         // It is better to show an OK button, but the policy require that we
45         // got a click on "Cancel"
46         ok()->clicked.connect(SigC::slot(this, &FormCredits::CancelClicked));
47
48         std::stringstream ss;
49         text()->insert(controller().getCredits(ss).str());
50 }
51
52
53 void FormCredits::show()
54 {
55         if (!dialog_)
56                 build();
57         
58         update();
59         dialog_->show();
60 }
61
62
63 void FormCredits::hide()
64 {
65         dialog_->hide();
66 }
67
68
69 void FormCredits::apply()
70 {
71 }
72
73
74 void FormCredits::update()
75 {
76 }
77
78
79 Gnome::Dialog * FormCredits::dialog()
80 {
81         return getWidget<Gnome::Dialog>("DiaHelpCredits");
82 }
83
84 Gtk::Text * FormCredits::text()
85 {
86         return getWidget<Gtk::Text>("credits_text");
87 }
88
89 Gtk::Button * FormCredits::ok()
90 {
91         return getWidget<Gtk::Button>("credits_button_ok");
92 }