1 /* $TOG: SpinBoxUiItem.C /main/5 1997/04/29 16:38:00 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/SpinBoxUiItem.hh>
24 // SpinBoxUiItem::SpinBoxUiItem
26 ////////////////////////////////////////////////////////////////////
28 SpinBoxUiItem::SpinBoxUiItem(Widget w, int source, char *search_key):PropUiItem(w, source, search_key)
32 #endif /* DEAD_WOOD */
34 options_spinbox_init(w, &(this->dirty_bit));
38 // SpinBoxUiItem::writeFromUiToSource()
39 // Takes values in the UI and puts them into the source DB
40 ///////////////////////////////////////////////////////////////////
41 void SpinBoxUiItem::writeFromUiToSource()
44 Widget w = this->getWidget();
47 spinbox_value = options_spinbox_get_value(w);
49 sprintf(val_str, "%d", spinbox_value);
51 prop_source->setValue(val_str);
55 // SpinBoxUiItem::writeFromSourceToUi()
56 // Takes values in the UI and puts them into the source DB
57 ///////////////////////////////////////////////////////////////////
58 void SpinBoxUiItem::writeFromSourceToUi()
61 Widget w = this->getWidget();
63 value = prop_source->getValue();
65 options_spinbox_set_value(w, atoi(value), this->dirty_bit);