source: git/src/buttontaghandler.cc

walls-data
Last change on this file was 4c83f84, checked in by Olly Betts <olly@…>, 6 days ago

Don't check HAVE_CONFIG_H in most cases

This check is only useful for img.c, which is intended to be usable
outside of Survex (and had fallbacks for functions which may not be
available which will get used if built in a non-autotools project).
For all the other source files it's just useless boilerplate.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/* buttontaghandler.cc
2 * Handle avenbutton tags
3 *
4 * Copyright (C) 2010 Olly Betts
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19 */
20
21#include <config.h>
22
23#include "aven.h"
24#include <wx/html/htmlwin.h>
25#include <wx/html/m_templ.h>
26#include <wx/html/forcelnk.h>
27
28FORCE_LINK_ME(buttontaghandler)
29
30TAG_HANDLER_BEGIN(AVENBUTTON, "AVENBUTTON")
31    TAG_HANDLER_PROC(tag) {
32        int id;
33        if (!tag.GetParamAsInt(wxT("id"), &id))
34            id = -1;
35        wxHtmlContainerCell * cells = m_WParser->GetContainer();
36        cells->SetAlignHor(wxHTML_ALIGN_RIGHT);
37        wxWindow * win = m_WParser->GetWindowInterface()->GetHTMLWindow();
38        wxButton * but = new wxButton(win, id, tag.GetParam(wxT("name")));
39        if (tag.HasParam(wxT("default")))
40            but->SetDefault();
41        cells->InsertCell(new wxHtmlWidgetCell(but));
42        return false;
43    }
44TAG_HANDLER_END(TITLE)
45
46TAGS_MODULE_BEGIN(CavernLog)
47    TAGS_MODULE_ADD(AVENBUTTON)
48TAGS_MODULE_END(CavernLog)
Note: See TracBrowser for help on using the repository browser.