~ubuntu-branches/ubuntu/lucid/asc/lucid

« back to all changes in this revision

Viewing changes to source/libs/paragui/src/widgets/pgcheckbutton.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Eddy Petrișor, Gonéri Le Bouder, Cyril Brulebois, Barry deFreese
  • Date: 2008-01-08 19:54:18 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080108195418-n19fc4eobhhqxcy5
Tags: 2.0.1.0-1
[ Eddy Petrișor ]
* fixed Homepage semifield

[ Gonéri Le Bouder ]
* add a watchfile
* move homepage from the description to the new Homepage field

[ Cyril Brulebois ]
* Added Vcs-Svn and Vcs-Browser fields in the control file.

[ Barry deFreese ]
* Fix make-clean lintian warning
* New upstream release
* Bump debhelper build-dep to match compat
* Add desktop file
* Update watch file for new upstream naming
* Remove nostrip check from rules
* Bump Standards Version to 3.7.3
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    ParaGUI - crossplatform widgetset
 
3
    Copyright (C) 2000,2001,2002  Alexander Pipelka
 
4
 
 
5
    This library is free software; you can redistribute it and/or
 
6
    modify it under the terms of the GNU Library General Public
 
7
    License as published by the Free Software Foundation; either
 
8
    version 2 of the License, or (at your option) any later version.
 
9
 
 
10
    This library is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
    Library General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU Library General Public
 
16
    License along with this library; if not, write to the Free
 
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 
 
19
    Alexander Pipelka
 
20
    pipelka@teleweb.at
 
21
 
 
22
    Last Update:      $Author: mbickel $
 
23
    Update Date:      $Date: 2007-10-10 19:28:36 $
 
24
    Source File:      $Source: /home/cvspsrv/cvsroot/games/asc/source/libs/paragui/src/widgets/pgcheckbutton.cpp,v $
 
25
    CVS/RCS Revision: $Revision: 1.2.2.1 $
 
26
    Status:           $State: Exp $
 
27
*/
 
28
 
 
29
#include "pgcheckbutton.h"
 
30
#include "pgbutton.h"
 
31
 
 
32
PG_CheckButton::PG_CheckButton(PG_Widget* parent, const PG_Rect& r, const std::string& text, int id, const std::string& style)
 
33
                : PG_RadioButton(parent, r, text, NULL, id) {
 
34
        LoadThemeStyle(style);
 
35
   my_widgetButton->LoadThemeStyle(style, "CheckButton");
 
36
 
 
37
        SetUnpressed();
 
38
}
 
39
 
 
40
PG_CheckButton::~PG_CheckButton() {}
 
41
 
 
42
bool PG_CheckButton::eventMouseButtonUp(const SDL_MouseButtonEvent* my_widgetButton) {
 
43
   if ( my_widgetButton->button == SDL_BUTTON_LEFT ) {
 
44
           if(my_isPressed) {
 
45
                   SetUnpressed();
 
46
           } else {
 
47
                   SetPressed();
 
48
           }
 
49
 
 
50
           return true;
 
51
   } else
 
52
      return false;
 
53
}
 
54
 
 
55
void PG_CheckButton::SetUnpressed() {
 
56
        my_widgetButton->SetPressed(false);
 
57
        my_isPressed = false;
 
58
 
 
59
        Update();
 
60
 
 
61
        // Notify parent
 
62
        sigClick(this, false);
 
63
}