1 /* $TOG: AntiCheckBoxUiItem.C /main/4 1997/04/29 15:57:39 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/AntiCheckBoxUiItem.hh>
24 // AntiCheckBoxUiItem::AntiCheckBoxUiItem
25 // AntiCheckBoxUiItem ctor
26 ////////////////////////////////////////////////////////////////////
28 AntiCheckBoxUiItem::AntiCheckBoxUiItem(
32 ):CheckBoxUiItem(w, source, search_key)
37 // AntiCheckBoxUiItem::writeFromUiToSource()
38 // Takes values in the UI and puts them into the source DB
39 ///////////////////////////////////////////////////////////////////
40 void AntiCheckBoxUiItem::writeFromUiToSource()
42 Boolean checkbox_value;
43 Widget w = this->getWidget();
44 PropSource *p_s = this->getPropSource();
46 checkbox_value = options_checkbox_get_value(w);
48 if(checkbox_value == TRUE) // make sure the value is in the table
58 // AntiCheckBoxUiItem::writeFromSourceToUi()
59 // Takes values in the UI and puts them into the source DB
60 ///////////////////////////////////////////////////////////////////
61 void AntiCheckBoxUiItem::writeFromSourceToUi()
64 Widget w = this->getWidget();
66 PropSource *p_s = this->getPropSource();
68 value = (char *)p_s->getValue();
71 // this will have to be made more robust...
73 // This assumes that a non-null value means that the
74 // value is set and that a non-null means turn on the CB
75 if (strcmp(value, "f") == 0)
76 options_checkbox_set_value(w, TRUE, this->dirty_bit);
77 else if (value == NULL || strcmp(value, "") == 0)
78 options_checkbox_set_value(w, FALSE, this->dirty_bit);