I've rewritten the credits dialog.  In order to get the program to 
compile I also had to hack configure.in.

I haven't formatted the info yet (too busy for a few days) but the raw 
contributors is in there.  All comments greatly appreciated as I'm still 
learning the source etc.

Cheers

Koz

credits.diff.gz

<?xml version="1.0"?>
<GTK-Interface>

<project>
  <name>diahelpcredits</name>
  <program_name>diahelpcredits</program_name>
  <directory></directory>
  <source_directory></source_directory>
  <pixmaps_directory>pixmaps</pixmaps_directory>
  <language>C</language>
  <gnome_support>True</gnome_support>
  <gettext_support>True</gettext_support>
  <use_widget_names>True</use_widget_names>
  <output_main_file>False</output_main_file>
  <output_build_files>False</output_build_files>
  <gnome_help_support>True</gnome_help_support>
  <main_source_file>diahelpcredits_interface.c</main_source_file>
  <main_header_file>diahelpcredits_interface.h</main_header_file>
  <handler_source_file>diahelpcredits_callbacks.c</handler_source_file>
  <handler_header_file>diahelpcredits_callbacks.h</handler_header_file>
</project>

<widget>
  <class>GnomeDialog</class>
  <name>DiaHelpCredits</name>
  <type>GTK_WINDOW_TOPLEVEL</type>
  <position>GTK_WIN_POS_NONE</position>
  <modal>False</modal>
  <default_height>300</default_height>
  <allow_shrink>True</allow_shrink>
  <allow_grow>True</allow_grow>
  <auto_shrink>False</auto_shrink>
  <auto_close>False</auto_close>
  <hide_on_close>False</hide_on_close>

  <widget>
    <class>GtkVBox</class>
    <child_name>GnomeDialog:vbox</child_name>
    <name>dialog-vbox3</name>
    <homogeneous>False</homogeneous>
    <spacing>8</spacing>
    <child>
      <padding>4</padding>
      <expand>True</expand>
      <fill>True</fill>
    </child>

    <widget>
      <class>GtkHButtonBox</class>
      <child_name>GnomeDialog:action_area</child_name>
      <name>dialog-action_area3</name>
      <layout_style>GTK_BUTTONBOX_END</layout_style>
      <spacing>8</spacing>
      <child_min_width>85</child_min_width>
      <child_min_height>27</child_min_height>
      <child_ipad_x>7</child_ipad_x>
      <child_ipad_y>0</child_ipad_y>
      <child>
        <padding>0</padding>
        <expand>False</expand>
        <fill>True</fill>
        <pack>GTK_PACK_END</pack>
      </child>

      <widget>
        <class>GtkButton</class>
        <name>credits_button_ok</name>
        <can_default>True</can_default>
        <can_focus>True</can_focus>
        <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
      </widget>
    </widget>

    <widget>
      <class>GtkVBox</class>
      <name>vbox4</name>
      <homogeneous>False</homogeneous>
      <spacing>0</spacing>
      <child>
        <padding>0</padding>
        <expand>True</expand>
        <fill>True</fill>
      </child>

      <widget>
        <class>GtkLabel</class>
        <name>label8</name>
        <label>All these people have contributed to the LyX project, Thanks,

Matthias</label>
        <justify>GTK_JUSTIFY_CENTER</justify>
        <wrap>False</wrap>
        <xalign>0.5</xalign>
        <yalign>0.5</yalign>
        <xpad>0</xpad>
        <ypad>0</ypad>
        <child>
          <padding>0</padding>
          <expand>False</expand>
          <fill>False</fill>
        </child>
      </widget>

      <widget>
        <class>GtkScrolledWindow</class>
        <name>scrolledwindow1</name>
        <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
        <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
        <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
        <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
        <child>
          <padding>0</padding>
          <expand>True</expand>
          <fill>True</fill>
        </child>

        <widget>
          <class>GtkText</class>
          <name>credits_text</name>
          <can_focus>True</can_focus>
          <editable>False</editable>
          <text>
</text>
        </widget>
      </widget>
    </widget>
  </widget>
</widget>

</GTK-Interface>
// -*- C++ -*-
/* This file is part of
 * =================================================
 * 
 *          LyX, The Document Processor
 *          Copyright 1995-2000 The LyX Team.
 *
 * ================================================= 
 *
 * \author Michael Koziarski <[EMAIL PROTECTED]>
 */

#ifdef __GNUG__
#pragma implementation
#endif

#include <config.h>

#include "gnomeBC.h"
#include "FormCredits.h"

#include <gnome--/dialog.h>
#include <gtk--/entry.h>
#include <gtk--/checkbutton.h>
#include <gtk--/text.h>

FormCredits::FormCredits(ControlCredits & c)
        : FormCB<ControlCredits>(c, "diahelpcredits.glade", "DiaHelpCredits")
{

}


FormCredits::~FormCredits()
{}


Gnome::Dialog * FormCredits::dialog()
{
        return getWidget<Gnome::Dialog>("DiaHelpCredits");
}

Gtk::Text * FormCredits::text()
{
        return getWidget<Gtk::Text>("credits_text");
}

void FormCredits::build()
{
        dialog_.reset(dialog());

        ok()->clicked.connect(SigC::slot(this, &FormCredits::OKClicked));
        std::stringstream ss;
        controller().getCredits(ss).str();
        
        text()->insert(controller().getCredits(ss).str());
        

}


void FormCredits::show()
{
        if (!dialog_.get())
                build();
        
        update();
        dialog_->show();
}


void FormCredits::hide()
{
        dialog_->hide();
}


void FormCredits::apply()
{
}


void FormCredits::update()
{
}


Gtk::Button * FormCredits::ok()
{
        return getWidget<Gtk::Button>("credits_button_ok");
}

// -*- C++ -*-
/* This file is part of
 * =================================================
 * 
 *          LyX, The Document Processor
 *          Copyright 1995 Matthias Ettrich.
 *          Copyright 1995-2000 The LyX Team.
 *
 * ================================================= 
 *
 * \author Michael Koziarski <[EMAIL PROTECTED]>
 * */

#ifndef FORMCREDITS_H
#define FORMCREDITS_H

#ifdef __GNUG__
#pragma interface
#endif

#include "ControlCredits.h"
#include "GnomeBase.h"
#include <boost/smart_ptr.hpp>

//#include <gnome--/dialog.h>
namespace Gnome {
class Dialog;
}

namespace Gtk {
class Button;
class CheckButton;
class Entry;
class Text;
}

/**
 * This class implements the dialog to insert/modify urls.
 */
class FormCredits : public FormCB<ControlCredits> {
public:
        ///
        FormCredits(ControlCredits & c);
        ///
        ~FormCredits();

        void apply();

        void hide();
        void show();
        void update();
        
private:
        
        /// get the dialog
        Gnome::Dialog * dialog();
        /// Build the dialog
        void build();

        void OKClicked() { OKButton(); }
        /// The ok button
        Gtk::Button * ok();
        
        Gtk::Text * text();

        // Hold the dialog.
        boost::shared_ptr<Gnome::Dialog> dialog_;
};

#endif

Reply via email to