Commit 7d72ce08 authored by claes's avatar claes

Initial value written in input field for also for other types than string

parent a30fc653
/*
* Proview $Id: wb_wdanav.cpp,v 1.8 2007-01-04 07:29:04 claes Exp $
* Proview $Id: wb_wdanav.cpp,v 1.9 2008-02-27 06:34:38 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -116,15 +116,13 @@ int WdaNav::check_attr( int *multiline, brow_tObject *node,
brow_GetUserData( node_list[0], (void **)&base_item);
free( node_list);
switch( base_item->type)
{
switch( base_item->type) {
case wnav_eItemType_Attr:
case wnav_eItemType_AttrInput:
case wnav_eItemType_AttrInputF:
case wnav_eItemType_AttrInputInv:
case wnav_eItemType_AttrOutput:
case wnav_eItemType_AttrArrayElem:
{
case wnav_eItemType_AttrArrayElem: {
WItemBaseAttr *item = (WItemBaseAttr *)base_item;
if ( !editmode)
......@@ -133,32 +131,33 @@ int WdaNav::check_attr( int *multiline, brow_tObject *node,
return WDA__FLAGNOEDIT;
if ( item->flags & PWR_MASK_STATE && !bypass)
return WDA__FLAGSTATE;
if ( item->type_id == pwr_eType_Text)
{
if ( item->type_id == pwr_eType_Text) {
*multiline = 1;
*size = item->size;
sts = item->get_value( init_value);
if ( EVEN(sts)) return sts;
}
else if ( item->type_id == pwr_eType_String)
{
else if ( item->type_id == pwr_eType_String) {
*multiline = 0;
*size = item->size;
sts = item->get_value( init_value);
if ( EVEN(sts)) return sts;
}
else
{
else {
char *valp;
int len;
*multiline = 0;
*init_value = NULL;
sts = item->get_value( &valp);
wnav_attrvalue_to_string( ldhses, item->type_id, valp, init_value, &len);
//*init_value = NULL;
*size = 40;
}
*node = item->node;
strcpy( name, item->attr);
break;
}
case wnav_eItemType_ObjectName:
{
case wnav_eItemType_ObjectName: {
if ( !editmode)
return WDA__NOEDIT;
sts = ((WItemObjectName *)base_item)->get_value( init_value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment