1 /* $TOG: TextFieldUiItem.C /main/7 1997/11/07 15:48:41 mgreess $ */
5 * RESTRICTED CONFIDENTIAL INFORMATION:
7 * The information in this document is subject to special
8 * restrictions in a confidential disclosure agreement bertween
9 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
10 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
11 * Sun's specific written approval. This documment and all copies
12 * and derivative works thereof must be returned or destroyed at
15 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
20 #include <DtMail/options_util.h>
21 #include <DtMail/PropUi.hh>
22 #include <DtMail/TextFieldUiItem.hh>
24 ////////////////////////////////////////////////////////////////////
25 TextFieldUiItem::TextFieldUiItem(
29 PropUiCallback validator,
30 void * validator_data)
31 : PropUiItem(w, source, search_key, validator, validator_data)
33 options_field_init(w, &(this->dirty_bit));
36 // Takes values in the UI and puts them into the source DB
37 ///////////////////////////////////////////////////////////////////
38 void TextFieldUiItem::writeFromUiToSource()
40 char *textfield_value;
41 Widget w = this->getWidget();
43 textfield_value = options_field_get_value(w);
44 prop_source->setValue(textfield_value);
47 // Takes values in the UI and puts them into the source DB
48 ///////////////////////////////////////////////////////////////////
49 void TextFieldUiItem::writeFromSourceToUi()
52 Widget w = this->getWidget();
54 value = (char *)prop_source->getValue();
55 options_field_set_value(w, value, this->dirty_bit);
56 if (NULL != value) free((void*) value);