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

Last change on this file since 2 was 2, checked in by Sanahuja Guillaume, 5 years ago

flaircore

File size: 1.2 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
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
24namespace flair
25{
26namespace gui
27{
28
29PushButton::PushButton(const LayoutPosition* position,string name): Widget(position->getLayout(),name,"PushButton")
30{
31    SetVolatileXmlProp("row",position->Row());
32    SetVolatileXmlProp("col",position->Col());
33    delete position;
34
35    SendXml();
36
37    clicked=false;
38}
39
40PushButton::~PushButton()
41{
42
43}
44
45void PushButton::XmlEvent(void)
46{
47    int clic=0;
48    GetPersistentXmlProp("value",clic);
49
50    if(clic==1) clicked=true;
51}
52
53bool PushButton::Clicked(void)
54{
55    if(clicked==true)
56    {
57       clicked=false;
58       return true;
59    }
60    else
61    {
62        return false;
63    }
64}
65
66} // end namespace gui
67} // end namespace flair
Note: See TracBrowser for help on using the repository browser.