本文整理汇总了C++中IupSetfAttribute函数的典型用法代码示例。如果您正苦于以下问题:C++ IupSetfAttribute函数的具体用法?C++ IupSetfAttribute怎么用?C++ IupSetfAttribute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IupSetfAttribute函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _run_geocode
// Runs geocode hostip callback
static int _run_geocode(/*@[email protected]*/ Ihandle *ih)
{
float lat,lon;
char city[100];
// Check if controls have been created
if( (lbl_status==NULL)
|| (list_method==NULL)
|| (edt_lat==NULL)
|| (edt_lon==NULL) ) {
LOG(LOGERR,_("Function called without GUI!"));
return IUP_DEFAULT;
}
LOG(LOGVERBOSE,_("Running geocode subfunction."));
IupSetAttribute(run_task,"RUN","NO");
IupSetAttribute(list_method,"VISIBLE","YES");
IupSetAttribute(list_method,"VALUE","0");
if(!location_geocode_hostip(&lat,&lon,city,100)) {
IupSetAttribute(lbl_status,"APPEND",_("Unable to download data"));
return IUP_DEFAULT;
}
IupSetfAttribute(lbl_status,"APPEND",_("city: %s"),city);
IupSetfAttribute(lbl_status,"APPEND",_("lat/lon: %.2f,%.2f"),lat,lon);
IupSetAttribute(lbl_status,"APPEND",_("Go to http://www.hostip.info/ to correct"));
IupSetfAttribute(edt_lat,"VALUE","%f",lat);
IupSetfAttribute(edt_lon,"VALUE","%f",lon);
return IUP_DEFAULT;
}
开发者ID:Ceropean,项目名称:redshiftgui,代码行数:31,代码来源:iupgui_location.c
示例2: iupdrvOpen
int iupdrvOpen(int *argc, char ***argv)
{
char* value;
if (!gtk_init_check(argc, argv))
return IUP_ERROR;
#if defined(IUPGTK_DEBUG)
g_log_set_default_handler(iupgtk_log, NULL);
#endif
IupSetGlobal("DRIVER", "GTK");
IupStoreGlobal("SYSTEMLANGUAGE", pango_language_to_string(gtk_get_default_language()));
/* driver system version */
IupSetfAttribute(NULL, "GTKVERSION", "%d.%d.%d", gtk_major_version,
gtk_minor_version,
gtk_micro_version);
IupSetfAttribute(NULL, "GTKDEVVERSION", "%d.%d.%d", GTK_MAJOR_VERSION,
GTK_MINOR_VERSION,
GTK_MICRO_VERSION);
gtkSetGlobalAttrib();
gtkSetGlobalColors();
IupSetGlobal("SHOWMENUIMAGES", "YES");
value = getenv("UBUNTU_MENUPROXY"); /* for now only in Ubuntu */
if (value && (iupStrEqualNoCase(value, "libappmenu.so") || iupStrEqualNoCase(value, "1")))
IupSetGlobal("GLOBALMENU", "Yes");
return IUP_NOERROR;
}
开发者ID:sanikoyes,项目名称:iup,代码行数:35,代码来源:iupgtk_open.c
示例3: iScrollBoxLayoutUpdate
static void iScrollBoxLayoutUpdate(Ihandle* ih)
{
int dx = ih->currentwidth,
dy = ih->currentheight;
/* already updated the canvas layout,
so just have to update the scrollbars and child. */
/* if child is greater than scrollbox, has scrollbars
but this affects the oposite direction */
if (ih->firstchild->currentwidth > ih->currentwidth)
dy -= iupdrvGetScrollbarSize();
if (ih->firstchild->currentheight > ih->currentheight)
dx -= iupdrvGetScrollbarSize();
IupSetfAttribute(ih, "DX", "%d", dx);
IupSetfAttribute(ih, "DY", "%d", dy);
if (ih->firstchild)
{
iScrollBoxUpdatePosition(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
iupLayoutUpdate(ih->firstchild);
}
}
开发者ID:Archs,项目名称:iup-aio,代码行数:26,代码来源:iup_scrollbox.c
示例4: iValSetTypeAttrib
static int iValSetTypeAttrib(Ihandle* ih, const char *value)
{
int min_w, min_h;
/* valid only before map */
if (ih->handle)
return 0;
iupdrvValGetMinSize(ih, &min_w, &min_h);
if (iupStrEqualNoCase(value, "VERTICAL"))
{
/* val natural vertical size is MinWx100 */
IupSetfAttribute(ih, "RASTERSIZE", "%dx%d", min_w, 100);
ih->data->type = IVAL_VERTICAL;
}
else /* "HORIZONTAL" */
{
/* val natural horizontal size is 100xMinH */
IupSetfAttribute(ih, "RASTERSIZE", "%dx%d", 100, min_h);
ih->data->type = IVAL_HORIZONTAL;
}
return 0; /* do not store value in hash table */
}
开发者ID:Airr,项目名称:iup_mac,代码行数:25,代码来源:iup_val.c
示例5: iupdrvOpen
int iupdrvOpen(int *argc, char ***argv)
{
GtkStyle* style;
if (!gtk_init_check(argc, argv))
return IUP_ERROR;
IupSetGlobal("DRIVER", "GTK");
IupStoreGlobal("SYSTEMLANGUAGE", pango_language_to_string(gtk_get_default_language()));
/* driver system version */
IupSetfAttribute(NULL, "GTKVERSION", "%d.%d.%d", gtk_major_version,
gtk_minor_version,
gtk_micro_version);
IupSetfAttribute(NULL, "GTKDEVVERSION", "%d.%d.%d", GTK_MAJOR_VERSION,
GTK_MINOR_VERSION,
GTK_MICRO_VERSION);
gtkSetDrvGlobalAttrib();
style = gtk_style_new();
iupgtkUpdateGlobalColors(style);
IupSetGlobal("_IUP_RESET_GLOBALCOLORS", "YES"); /* will update the global colors when the first dialog is mapped */
g_object_unref(style);
return IUP_NOERROR;
}
开发者ID:gcfavorites,项目名称:tastools,代码行数:28,代码来源:iupgtk_open.c
示例6: _address_lookup
// Address lookup function
static int _address_lookup(/*@[email protected]*/ Ihandle *ih) {
char *result = IupGetAttribute(edt_address,"VALUE");
float lat,lon;
char city[100];
int rescode;
if( result == NULL )
return IUP_DEFAULT;
IupSetAttribute(list_method,"VISIBLE","YES");
IupSetAttribute(list_method,"VALUE","0");
IupSetAttribute(lbl_status,"VALUE","");
IupSetfAttribute(lbl_status,"APPEND",
_("Downloading info, this may be slow..."));
rescode=location_address_lookup(result,&lat,&lon,city,100);
// Destroy address box
if( hbox_address )
IupDestroy(hbox_address);
hbox_address = btn_address = edt_address = NULL;
if( dialog_location )
IupRefresh(dialog_location);
if(!rescode) {
IupSetAttribute(lbl_status,"APPEND",_("Unable to download data"));
return IUP_DEFAULT;
}
IupSetfAttribute(lbl_status,"APPEND",_("city: %s"),city);
IupSetfAttribute(lbl_status,"APPEND",_("lat/lon: %.2f,%.2f"),lat,lon);
IupSetfAttribute(edt_lat,"VALUE","%f",lat);
IupSetfAttribute(edt_lon,"VALUE","%f",lon);
return IUP_DEFAULT;
}
开发者ID:Ceropean,项目名称:redshiftgui,代码行数:34,代码来源:iupgui_location.c
示例7: IupImage
Ihandle* IupImage (int width, int height, const unsigned char *pixmap)
{
Ihandle *n = iupTreeCreateNode(NULL);
type(n) = IMAGE_;
IupSetfAttribute(n,IUP_WIDTH,"%u", width);
IupSetfAttribute(n,IUP_HEIGHT,"%u", height);
IupSetAttribute(n,"BPP","8");
IupSetAttribute(n,"CHANNELS","1");
image_data(n) = (char *) malloc (width*height);
if (image_data(n) && pixmap)
memcpy (image_data(n),pixmap,width*height);
return n;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:13,代码来源:icreate.c
示例8: save_image_cb
int save_image_cb(void)
{
if(gc.image == NULL) {
IupSetfAttribute(gc.msgbar, "TITLE", "There's no image to save");
return IUP_DEFAULT;
}
image_copy = imgCopy(gc.image);
IupSetfAttribute(gc.msgbar, "TITLE", "State of the image saved");
return IUP_DEFAULT;
}
开发者ID:ninofabrizio,项目名称:Computacao-Grafica,代码行数:13,代码来源:main_Nino.c
示例9: time_cb
int time_cb(void)
{
float value = IupGetFloat(progressbar1, "VALUE");
value += increment;
if (value > 1) value = 0; /* start over */
IupSetfAttribute(progressbar1, "VALUE", "%g", (double)value);
value = IupGetFloat(progressbar2, "VALUE");
value += increment*50;
if (value > 50) value = 0; /* start over */
IupSetfAttribute(progressbar2, "VALUE", "%g", (double)value);
return IUP_DEFAULT;
}
开发者ID:defdef,项目名称:iup,代码行数:13,代码来源:progressbar.c
示例10: iScrollBoxLayoutUpdate
static void iScrollBoxLayoutUpdate(Ihandle* ih)
{
int w, h;
IupGetIntInt(ih, "DRAWSIZE", &w, &h);
IupSetfAttribute(ih, "DX", "%d", w);
IupSetfAttribute(ih, "DY", "%d", h);
if (ih->firstchild)
{
iScrollBoxUpdatePosition(ih, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));
iupLayoutUpdate(ih->firstchild);
}
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:13,代码来源:iup_scrollbox.c
示例11: resize_cb
int resize_cb(Ihandle *ih, int w, int h)
{
/* update page size, it is always the client size of the canvas */
IupSetfAttribute(ih, "DX", "%d", w);
IupSetfAttribute(ih, "DY", "%d", h);
if (!cdcanvas)
return IUP_DEFAULT;
/* update CD canvas size */
cdCanvasActivate(cdcanvas);
return IUP_DEFAULT;
}
开发者ID:svn2github,项目名称:iup-github,代码行数:13,代码来源:scrollbar.c
示例12: print_value
static void print_value(Ihandle *ih, double a)
{
char *type = IupGetAttribute(ih, "TYPE");
switch(type[0])
{
case 'V':
IupSetfAttribute(lbl_v, "TITLE", "VALUE=%.2f", a);
break;
case 'H':
IupSetfAttribute(lbl_h, "TITLE", "VALUE=%.2f", a);
break;
}
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:14,代码来源:val.c
示例13: load_image_cb
int load_image_cb(void) {
if(image_copy == NULL) {
IupSetfAttribute(gc.msgbar, "TITLE", "There's no copy of image saved");
return IUP_DEFAULT;
}
gc.image = imgCopy(image_copy);
repaint_cb(gc.canvas);
IupSetfAttribute(gc.msgbar, "TITLE", "Last state saved is loaded");
return IUP_DEFAULT;
}
开发者ID:ninofabrizio,项目名称:Computacao-Grafica,代码行数:14,代码来源:main_Nino.c
示例14: _list_method_cb
// List method changes
static int _list_method_cb(/*@[email protected]*/ Ihandle *ih,
/*@[email protected]*/ char *text, int pos, int state) {
if( state == 0 )
return IUP_DEFAULT;
if( !run_task )
run_task = IupSetAtt(NULL,IupTimer(),"TIME","100",NULL);
switch(pos) {
case 1:
LOG(LOGVERBOSE,_("Running geocode with hostip"));
IupSetAttribute(lbl_status,"VALUE","");
IupSetfAttribute(lbl_status,"APPEND",
_("Downloading info, this may be slow..."));
(void)IupSetCallback(run_task,"ACTION_CB",(Icallback)_run_geocode);
IupSetAttribute(run_task,"RUN","YES");
IupSetAttribute(list_method,"VISIBLE","NO");
break;
case 2:
LOG(LOGVERBOSE,_("Running geocode with geobytes"));
IupSetAttribute(lbl_status,"VALUE","");
IupSetfAttribute(lbl_status,"APPEND",
_("Downloading info, this may be slow..."));
(void)IupSetCallback(run_task,"ACTION_CB",(Icallback)_run_geobytes);
IupSetAttribute(run_task,"RUN","YES");
IupSetAttribute(list_method,"VISIBLE","NO");
break;
case 3: {
edt_address = IupSetAtt(NULL,IupText(NULL),
"VALUE","Enter Address...",
"EXPAND","HORIZONTAL",NULL);
(void)IupSetCallback(edt_address,"GETFOCUS_CB",(Icallback)_address_clear);
btn_address = IupSetAtt(NULL,IupButton(_("Lookup"),NULL),NULL);
(void)IupSetCallback(btn_address,"ACTION",(Icallback)_address_lookup);
hbox_address = IupHbox(edt_address,btn_address,NULL);
if( (vbox_method!=NULL)
&& (hbox_address!=NULL)
&& (lbl_status!=NULL) )
(void)IupInsert(vbox_method,lbl_status,hbox_address);
else {
LOG(LOGERR,_("Location search controls not created!"));
return IUP_DEFAULT;
}
IupSetAttribute(list_method,"VISIBLE","NO");
(void)IupMap(hbox_address);
IupRefresh(hbox_address);
break;
}
};
return IUP_DEFAULT;
}
开发者ID:Ceropean,项目名称:redshiftgui,代码行数:50,代码来源:iupgui_location.c
示例15: iupmotCBcaret
void iupmotCBcaret (Widget w, XtPointer client_data, XtPointer call_data)
{
IFnii cb;
Iwidgetdata *d = NULL;
Ihandle *n;
XmTextVerifyCallbackStruct* textverify = (XmTextVerifyCallbackStruct*)call_data;
if (iupmot_incallback) return;
XtVaGetValues (w, XmNuserData, &d, NULL);
if (!d) return;
n = d->ihandle;
if (n == NULL) return;
cb = (IFnii) IupGetCallback(n, "CARET_CB");
if (cb)
{
int old_col, old_row, col, row=1;
long int pos;
pos = textverify->newInsert;
if (type(n) == TEXT_ || (type(n) == LIST_ && iupCheck(n, "EDITBOX")==YES))
{
col = pos+1;
}
else /* MULTILINE_ */
{
long int linText, colText;
char *str = XmTextGetString((Widget)handle(n));
iupmotLincol( str, pos, &linText, &colText );
row = linText;
col = colText;
}
old_col = IupGetInt(n, "_IUPMOT_CARETCOL");
old_row = IupGetInt(n, "_IUPMOT_CARETROW");
if (row != old_row || col != old_col)
{
IupSetfAttribute(n, "_IUPMOT_CARETCOL", "%d", col);
IupSetfAttribute(n, "_IUPMOT_CARETROW", "%d", row);
iupmot_incallback = TRUE;
if (cb(n, row, col) == IUP_CLOSE)
iupmot_exitmainloop = 1;
iupmot_incallback = FALSE;
}
}
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:49,代码来源:motproc.c
示例16: map_cb
static int map_cb(Ihandle *ih)
{
cdCanvas *canvas = cdCreateCanvas(CD_IUP, ih);
/* World size is fixed */
wdCanvasWindow(canvas, 0, WORLD_W, 0, WORLD_H);
/* handle scrollbar in world coordinates, so we only have to update DX/DY */
IupSetAttribute(ih, "XMIN", "0");
IupSetAttribute(ih, "YMIN", "0");
IupSetfAttribute(ih, "XMAX", "%d", WORLD_W);
IupSetfAttribute(ih, "YMAX", "%d", WORLD_H);
return IUP_DEFAULT;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:15,代码来源:canvas_scrollbar.c
示例17: iScrollBoxSetChildrenCurrentSizeMethod
static void iScrollBoxSetChildrenCurrentSizeMethod(Ihandle* ih, int shrink)
{
/* update child to its own natural size */
if (ih->firstchild)
{
iupBaseSetCurrentSize(ih->firstchild, ih->firstchild->naturalwidth, ih->firstchild->naturalheight, shrink);
IupSetfAttribute(ih, "XMAX", "%d", ih->firstchild->currentwidth);
IupSetfAttribute(ih, "YMAX", "%d", ih->firstchild->currentheight);
}
else
{
IupSetAttribute(ih, "XMAX", "0");
IupSetAttribute(ih, "YMAX", "0");
}
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:16,代码来源:iup_scrollbox.c
示例18: load_cb
/* carrega uma nova cena */
int load_cb(void) {
char* filename = get_file_name(); /* chama o dialogo de abertura de arquivo */
char buffer[30];
if (filename==NULL) return 0;
/* Le a cena especificada */
scene = sceLoad( filename );
if( scene == NULL ) return IUP_DEFAULT;
camera = sceGetCamera( scene );
eye = camGetEye( camera );
width = camGetScreenWidth( camera );
height = camGetScreenHeight( camera );
yc=0;
if (image) imgDestroy(image);
image = imgCreate( width, height );
IupSetfAttribute(label, "TITLE", "%3dx%3d", width, height);
sprintf(buffer,"%3dx%3d", width, height);
IupSetAttribute(canvas,IUP_RASTERSIZE,buffer);
IupSetFunction (IUP_IDLE_ACTION, (Icallback) idle_cb);
start_time = clock();
IupGLMakeCurrent(canvas);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
glEnd();
glFlush();
IupGLSwapBuffers(canvas); /* change the back buffer with the front buffer */
return IUP_DEFAULT;
}
开发者ID:juliords,项目名称:pucrio-cg-20112,代码行数:34,代码来源:mainIUP.c
示例19: iMatrixAuxUpdateVisibleSize
static void iMatrixAuxUpdateVisibleSize(Ihandle* ih, int m)
{
char* D;
ImatLinColData *p;
int canvas_size;
if (m == IMAT_PROCESS_LIN)
{
D = "DY";
p = &(ih->data->lines);
canvas_size = ih->data->h;
}
else
{
D = "DX";
p = &(ih->data->columns);
canvas_size = ih->data->w;
}
/* Matrix useful area is the current size minus the title area */
p->visible_size = canvas_size - p->sizes[0];
if (p->visible_size > p->total_size)
p->visible_size = p->total_size;
if (p->total_size)
IupSetfAttribute(ih, D, "%f", (double)p->visible_size/(double)p->total_size);
else
IupSetAttribute(ih, D, "1.0");
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:29,代码来源:iupmat_aux.c
示例20: binary_cb
int binary_cb(void)
{
Image* tmp = gc.image;
if (tmp != NULL){
IupSetfAttribute(gc.msgbar, "TITLE", "Grey scale image ...");
gc.image = imgGrey(tmp);
repaint_cb(gc.canvas); /* repaint canvas */
imgDestroy(tmp);
tmp = gc.image;
gc.image = imgBinary(tmp);
repaint_cb(gc.canvas); /* repaint canvas */
imgDestroy(tmp);
IupSetfAttribute(gc.msgbar, "TITLE", "Binary image ...");
}
return IUP_DEFAULT;
}
开发者ID:ninofabrizio,项目名称:Computacao-Grafica,代码行数:16,代码来源:main_Nino.c
注:本文中的IupSetfAttribute函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论