news download themes documentation links










IntResMenuItem Class Reference

Changes an resource integer value between min and max. More...

#include <IntResMenuItem.hh>

Inheritance diagram for IntResMenuItem:

FbTk::MenuItem List of all members.

Public Member Functions

 IntResMenuItem (const char *label, FbTk::Resource< int > &res, int min_val, int max_val)
void click (int button, int time)

Detailed Description

Changes an resource integer value between min and max.

Definition at line 31 of file IntResMenuItem.hh.


Member Function Documentation

void IntResMenuItem::click int  button,
int  time
[virtual]
 

! TODO: must have some sort of "global" double click time in FbTk

Reimplemented from FbTk::MenuItem.

Definition at line 45 of file IntResMenuItem.cc.

00045                                                {
00046     static int last_time = -201;
00047     int inc_val = 1;
00048     // check double click
00050     if (time - last_time <= 200)
00051         inc_val = 5;
00052 
00053     last_time = time;
00054 
00055     if ((button == 4 || button == 3)&& *m_res < m_max) // scroll up
00056         (*m_res) += inc_val;
00057     else if ((button == 5 || button == 1) && *m_res > m_min) // scroll down
00058         (*m_res) -= inc_val;
00059 
00060     // clamp value
00061     if (*m_res > m_max)
00062         *m_res = m_max;
00063     else if (*m_res < m_min)
00064         *m_res = m_min;
00065 
00066     // update label
00067     setLabel(appendIntValue(m_org_label, *m_res).c_str());
00068     // call other commands
00069     MenuItem::click(button, time);
00070 }


The documentation for this class was generated from the following files:

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA