vdk 2.4.0
vdkgnomeappbar.h
00001 /*
00002  * ===========================
00003  * VDK Visual Develeopment Kit
00004  * Version 1.0.4
00005  * December 1999
00006  * ===========================
00007  *
00008  * Copyright (C) 1998, Mario Motta
00009  * Developed by Mario Motta <mmotta@guest.net>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public
00022  * License along with this library; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024  * 02111-1307, USA.
00025  */
00026 
00027 #ifndef GNOME_APPBAR_H
00028 #define GNOME_APPBAR_H
00029 
00030 #if HAVE_GNOME
00031 #include <vdk/vdkobj.h>
00032 #include <gnome.h>
00033 class VDKForm;
00042 class VDKGnomeAppBar: public VDKObject
00043 {
00044     VDKObject* progress;
00045  public:
00049     VDKReadWriteValueProp<VDKGnomeAppBar, char*> Status;
00053     VDKReadWriteValueProp<VDKGnomeAppBar, char*> Default;
00057     VDKReadWriteValueProp<VDKGnomeAppBar, float> Progress;
00065     VDKGnomeAppBar(VDKForm* owner,
00066                bool has_progress = true,
00067                bool has_status = true,
00068                GnomePreferencesType interact = GNOME_PREFERENCES_USER);
00072     virtual ~VDKGnomeAppBar();
00073 
00078     void Push(char* status)
00079       {
00080         gnome_appbar_push(GNOME_APPBAR(widget),status);
00081       }
00085     void Pop()
00086      {
00087          gnome_appbar_pop(GNOME_APPBAR(widget));
00088      }
00092     void Clear()
00093       {
00094          gnome_appbar_clear_stack(GNOME_APPBAR(widget));
00095       }
00099     void Refresh()
00100      {
00101          gnome_appbar_refresh(GNOME_APPBAR(widget));    
00102      }
00103     void SetStatus(char* status)
00104       {
00105         gnome_appbar_set_status(GNOME_APPBAR(widget),status);
00106       }
00107     void SetDefault(char* default_status)
00108       {
00109         gnome_appbar_set_default(GNOME_APPBAR(widget),default_status);
00110       }
00111     void SetProgress(float value)
00112       {
00113         if(progress)
00114           gtk_progress_set_percentage(
00115                       GTK_PROGRESS(progress->Widget()),value);
00116       }
00117     float GetProgress()
00118       {
00119         if(progress)
00120           return gtk_progress_get_current_percentage(
00121                                      GTK_PROGRESS(progress->Widget()));
00122         else
00123           return 0.0;
00124       }
00125     
00126 };
00127 #endif
00128 
00129 #endif