source: flair-src/trunk/lib/FlairCore/src/PushButton.cpp

Last change on this file was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

File size: 1.2 KB
RevLine 
[2]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[2]4// %flair:license}
5// created: 2011/10/07
6// filename: PushButton.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Class displaying a QPushButton on the ground station
14//
15//
16/*********************************************************************/
17
18#include "PushButton.h"
19#include "Layout.h"
20#include "LayoutPosition.h"
21
22using std::string;
23
[15]24namespace flair {
25namespace gui {
[2]26
[15]27PushButton::PushButton(const LayoutPosition *position, string name)
28 : Widget(position->getLayout(), name, "PushButton") {
29 SetVolatileXmlProp("row", position->Row());
30 SetVolatileXmlProp("col", position->Col());
31 delete position;
[2]32
[15]33 SendXml();
[2]34
[15]35 clicked = false;
[2]36}
37
[15]38PushButton::~PushButton() {}
[2]39
[15]40void PushButton::XmlEvent(void) {
41 int clic = 0;
42 GetPersistentXmlProp("value", clic);
[2]43
[15]44 if (clic == 1)
45 clicked = true;
[2]46}
47
[15]48bool PushButton::Clicked(void) {
49 if (clicked == true) {
50 clicked = false;
51 return true;
52 } else {
53 return false;
54 }
[2]55}
56
57} // end namespace gui
58} // end namespace flair
Note: See TracBrowser for help on using the repository browser.