Freeciv-3.3
Loading...
Searching...
No Matches
values_dlg.cpp
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18// utility
19#include "string_vector.h"
20
21// ruledit
22#include "helpeditor.h"
23
24#include "values_dlg.h"
25
26
27/**********************************************************************/
31{
32 help = nullptr;
33}
34
35/**********************************************************************/
38void values_dlg::open_help(struct strvec **helptext)
39{
40 if (help == nullptr) {
41 // Create the strvec if it does not exist
42 if (*helptext == nullptr) {
43 *helptext = strvec_new();
44 }
45
46 // Make sure there's at least one element to edit
47 if (strvec_size(*helptext) == 0) {
48 strvec_append(*helptext, "");
49 }
50
51 help = new helpeditor(this, *helptext);
52
53 help->show();
54 }
55}
56
57/**********************************************************************/
61{
62 if (help != nullptr) {
63 help->close();
64
65 help = nullptr;
66 }
67}
void close()
void close_help()
helpeditor * help
Definition values_dlg.h:37
void open_help(struct strvec **help)
void strvec_append(struct strvec *psv, const char *string)
struct strvec * strvec_new(void)
size_t strvec_size(const struct strvec *psv)