source: flair-src/trunk/lib/FlairCore/src/Box.cpp@ 12

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

flaircore

File size: 1.3 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/28
6// filename: Box.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Abstract class to display a box on the ground station
14//
15//
16/*********************************************************************/
17#include "Box.h"
18#include "Layout.h"
19#include "LayoutPosition.h"
20
21using std::string;
22
23namespace flair
24{
25namespace gui
26{
27
28Box::Box(const LayoutPosition* position,string name,string type): Widget(position->getLayout(),name,type)
29{
30 value_changed=true;
31 SetVolatileXmlProp("row",position->Row());
32 SetVolatileXmlProp("col",position->Col());
33 delete position;
34}
35
36Box::~Box()
37{
38core::Object::ObjectName();
39}
40
41bool Box::ValueChanged(void)
42{
43 bool ret;
44
45 GetMutex();
46 if(value_changed==true)
47 {
48 value_changed=false;
49 ret=true;
50 }
51 else
52 {
53 ret=false;
54 }
55 ReleaseMutex();
56
57 return ret;
58}
59
60void Box::SetValueChanged(void)
61{
62 value_changed=true;
63}
64
65void Box::GetMutex(void) const
66{
67 ((Layout*)Parent())->mutex->GetMutex();
68}
69
70void Box::ReleaseMutex(void) const
71{
72 ((Layout*)Parent())->mutex->ReleaseMutex();
73}
74
75} // end namespace gui
76} // end namespace flair
Note: See TracBrowser for help on using the repository browser.