summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-04-06 19:57:27 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-04-06 20:02:42 +0200
commit21fb8725c656d6f8325d1a5cf22fac594651002d (patch)
treed927d9448f78de7b9bf267ec8b708e4698cd27fe /fluid
parent7793fa812ac4874ca64b2979f725157dbfddb95c (diff)
Generate copyright year in fluid's about_panel
Copyright year "1998-XXXX" is now generated from current year. This avoids editing the source code every year.
Diffstat (limited to 'fluid')
-rw-r--r--fluid/about_panel.cxx16
-rw-r--r--fluid/about_panel.fl24
-rw-r--r--fluid/about_panel.h7
3 files changed, 33 insertions, 14 deletions
diff --git a/fluid/about_panel.cxx b/fluid/about_panel.cxx
index c9cd7b22a..d4ef95098 100644
--- a/fluid/about_panel.cxx
+++ b/fluid/about_panel.cxx
@@ -3,17 +3,17 @@
//
// About dialog for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
-// http://www.fltk.org/COPYING.php
+// https://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
-// http://www.fltk.org/str.php
+// https://www.fltk.org/str.php
//
// generated by Fast Light User Interface Designer (fluid) version 1.0400
@@ -265,6 +265,12 @@ static void cb_Close(Fl_Return_Button* o, void*) {
}
Fl_Double_Window* make_about_panel() {
+ static char cbuf[200] = "";
+ if (!cbuf[0]) {
+ time_t t = time(0);
+ struct tm *lt = localtime(&t);
+ sprintf(cbuf, "Copyright © 1998 - %d\nby Bill Spitzak and others", lt->tm_year+1900);
+ }
{ about_panel = new Fl_Double_Window(345, 180, "About FLUID");
about_panel->color(FL_LIGHT1);
about_panel->selection_color(FL_DARK1);
@@ -282,8 +288,10 @@ Fl_Double_Window* make_about_panel() {
snprintf(about,sizeof(about),"FLTK User\nInterface Designer\nVersion %d.%d.%d",FL_MAJOR_VERSION,FL_MINOR_VERSION,FL_PATCH_VERSION);
o->copy_label(about);
} // Fl_Box* o
- { Fl_Box* o = new Fl_Box(135, 90, 200, 45, "Copyright 1998-2018 by\nBill Spitzak and others");
+ { // Label edited dynamically:
+ Fl_Box* o = new Fl_Box(135, 90, 200, 45, "(Copyright)");
o->align(Fl_Align(132|FL_ALIGN_INSIDE));
+ o->label(cbuf);
} // Fl_Box* o
{ Fl_Button* o = new Fl_Button(115, 145, 123, 25, "View License...");
o->labelcolor(FL_DARK_BLUE);
diff --git a/fluid/about_panel.fl b/fluid/about_panel.fl
index bb54debf6..be0003c72 100644
--- a/fluid/about_panel.fl
+++ b/fluid/about_panel.fl
@@ -7,29 +7,38 @@ comment {//
//
// About dialog for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
-// http://www.fltk.org/COPYING.php
+// https://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
-// http://www.fltk.org/str.php
+// https://www.fltk.org/str.php
//
} {in_source in_header
}
+decl {\#include <time.h>} {public global
+}
+
decl {void show_help(const char *name);} {public local
}
Function {make_about_panel()} {open
} {
+ code {static char cbuf[200] = "";
+ if (!cbuf[0]) {
+ time_t t = time(0);
+ struct tm *lt = localtime(&t);
+ sprintf(cbuf, "Copyright © 1998 - %d\\nby Bill Spitzak and others", lt->tm_year+1900);
+ }} {}
Fl_Window about_panel {
- label {About FLUID} open selected
- xywh {340 195 345 180} type Double color 50 selection_color 47 hide hotspot
+ label {About FLUID} open
+ xywh {340 190 345 180} type Double color 50 selection_color 47 hide hotspot
code0 {\#include "../src/flstring.h"} non_modal
} {
Fl_Box {} {
@@ -45,9 +54,10 @@ Version x.x.x}
code2 {o->copy_label(about);}
}
Fl_Box {} {
- label {Copyright 1998-2018 by
-Bill Spitzak and others}
+ label {(Copyright)}
+ comment {Label edited dynamically:} selected
xywh {135 90 200 45} align 148
+ code0 {o->label(cbuf);}
}
Fl_Button {} {
label {View License...}
diff --git a/fluid/about_panel.h b/fluid/about_panel.h
index 3c8fd44e6..2a7c69903 100644
--- a/fluid/about_panel.h
+++ b/fluid/about_panel.h
@@ -3,17 +3,17 @@
//
// About dialog for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
-// http://www.fltk.org/COPYING.php
+// https://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
-// http://www.fltk.org/str.php
+// https://www.fltk.org/str.php
//
// generated by Fast Light User Interface Designer (fluid) version 1.0400
@@ -21,6 +21,7 @@
#ifndef about_panel_h
#define about_panel_h
#include <FL/Fl.H>
+#include <time.h>
extern void show_help(const char *name);
#include <FL/Fl_Double_Window.H>
#include "../src/flstring.h"