ProcessViewBrowser-ServerProgramming
|
#include <processviewserver.h>
Public Member Functions | |
pvWidgetIdManager () | |
virtual | ~pvWidgetIdManager () |
int | init (PARAM *p, int id_start) |
virtual int | newId (const char *name) |
virtual int | deleteWidget (PARAM *p, const char *name) |
virtual int | id (const char *name) |
virtual int | isInMap (const char *name) |
int | isInMap (int id) |
int | firstId () |
int | nextId () |
int | endId () |
const char * | name (int id) |
int | idStart () |
virtual int | readEnumFromMask (const char *maskname) |
Private Member Functions | |
int | insertBasicId (int id, const char *name) |
Private Attributes | |
int | id_start |
int | num_additional_widgets |
int * | free |
std::map< std::string, int > | id_list |
std::multimap< std::string, int >::iterator | it |
Use this class for manageing p->num_additional_widgets by widget names Example:
typedef struct // (todo: define your data structure here) { pvWidgetIdManager mgr; } DATA;
static int slotInit(PARAM *p, DATA *d) { if(p == NULL || d == NULL) return -1; int id;
d->mgr.init(p,ID_END_OF_WIDGETS);
id = d->mgr.newId("test1"); pvQPushButton(p,id,0); pvSetGeometry(p,id,270,40,100,30); pvSetText(p,id,"test1"); pvShow(p,id);
return 0; } }
static int slotButtonPressedEvent(PARAM *p, int id, DATA *d) { if(p == NULL || id == 0 || d == NULL) return -1; if(id == obj1) { printf("knowns id's:\n"); int i = d->mgr.first(); while(i > 0) { printf("name=%s id=%d\n", d->mgr.name(i),i); i = d->mgr.next(); } } return 0; }
pvWidgetIdManager::pvWidgetIdManager | ( | ) |
|
virtual |
|
virtual |
int pvWidgetIdManager::endId | ( | ) |
int pvWidgetIdManager::firstId | ( | ) |
|
virtual |
int pvWidgetIdManager::idStart | ( | ) |
int pvWidgetIdManager::init | ( | PARAM * | p, |
int | id_start | ||
) |
|
private |
|
virtual |
int pvWidgetIdManager::isInMap | ( | int | id | ) |
const char* pvWidgetIdManager::name | ( | int | id | ) |
|
virtual |
int pvWidgetIdManager::nextId | ( | ) |
|
virtual |
|
private |
|
private |
|
private |
|
private |
|
private |