Hi all,
I have a PtComboBox as widget with editing enabled and following callbacks:
- List Item Selected
- Modify Verify
The problem is that modify_verify is also called when the user selects an
item of the list. Am I assuming right that this is correct behavior since
the selection modifies the text? Can it be avoided and how? When this is not
possible, how can I determine the origin for the modify_verify callback so I
can ignore it and wait for the item_selected callback? Is there a list of
pending callbacks which can be checked?
Thanks for any pointer or help
Markus
You can check, if new text is equal to one of items, in ModifyVerify
callback,
and decided there what to do. Here is a code from my program:
int TComboBox :: IsListItem (PtWidget_t *widget, const char *pNewText)
{
TComboBox comboBox (widget);
int n = comboBox.GetItemsCount (); //
Pt_ARG_LIST_ITEM_COUNT
const char **arr = comboBox.GetItemsAddr (); // Pt_ARG_ITEMS
if (pNewText == 0)
pNewText = “”;
int found = 0;
for (int i = 0; found <= 0 && i < n; i ++) {
const char *p = arr ;
if (strcmp (p, pNewText) == 0)
found = 1;
}
return found;
}
V. Ivashko
“Markus Jauslin” <markus.jauslin@ch.mullermartini.com> wrote in message
news:99u4j3$1fl$1@inn.qnx.com…
_Hi all,
I have a PtComboBox as widget with editing enabled and following
callbacks:
- List Item Selected
- Modify Verify
The problem is that modify_verify is also called when the user selects an
item of the list. Am I assuming right that this is correct behavior since
the selection modifies the text? Can it be avoided and how? When this is
not
possible, how can I determine the origin for the modify_verify callback so
I
can ignore it and wait for the item_selected callback? Is there a list of
pending callbacks which can be checked?
Thanks for any pointer or help
Markus_
Thanks for your hint. I’m doing this already but for me this is not
satisfactory enough and I’m looking for a more elegant solution.
Markus
V.Ivashko <ivvon@alice.dp.ua> schrieb in im Newsbeitrag:
9aogpl$e8l$1@inn.qnx.com…
You can check, if new text is equal to one of items, in ModifyVerify
callback,
and decided there what to do. Here is a code from my program:
int TComboBox :: IsListItem (PtWidget_t *widget, const char *pNewText)
{
TComboBox comboBox (widget);
int n = comboBox.GetItemsCount (); //
Pt_ARG_LIST_ITEM_COUNT
const char **arr = comboBox.GetItemsAddr (); // Pt_ARG_ITEMS
if (pNewText == 0)
pNewText = “”;
int found = 0;
for (int i = 0; found <= 0 && i < n; i ++) {
const char *p = arr > _;
if (strcmp (p, pNewText) == 0)
found = 1;
}
return found;
}
V. Ivashko
“Markus Jauslin” <> markus.jauslin@ch.mullermartini.com> > wrote in message
news:99u4j3$1fl$> 1@inn.qnx.com> …
Hi all,
I have a PtComboBox as widget with editing enabled and following
callbacks:
- List Item Selected
- Modify Verify
The problem is that modify_verify is also called when the user selects
an
item of the list. Am I assuming right that this is correct behavior
since
the selection modifies the text? Can it be avoided and how? When this is
not
possible, how can I determine the origin for the modify_verify callback
so
I
can ignore it and wait for the item_selected callback? Is there a list
of
pending callbacks which can be checked?
Thanks for any pointer or help
Markus_
\
The version used is QNX 4.25 and Photon 1.14 Patch C from May 2001 CD.
“Markus Jauslin” <markus.jauslin@ch.mullermartini.com> schrieb im
Newsbeitrag news:9d87th$p90$1@inn.qnx.com…
Thanks for your hint. I’m doing this already but for me this is not
satisfactory enough and I’m looking for a more elegant solution.
Markus
V.Ivashko <> ivvon@alice.dp.ua> > schrieb in im Newsbeitrag:
9aogpl$e8l$> 1@inn.qnx.com> …
You can check, if new text is equal to one of items, in ModifyVerify
callback,
and decided there what to do. Here is a code from my program:
int TComboBox :: IsListItem (PtWidget_t *widget, const char *pNewText)
{
TComboBox comboBox (widget);
int n = comboBox.GetItemsCount (); //
Pt_ARG_LIST_ITEM_COUNT
const char **arr = comboBox.GetItemsAddr (); // Pt_ARG_ITEMS
if (pNewText == 0)
pNewText = “”;
int found = 0;
for (int i = 0; found <= 0 && i < n; i ++) {
const char *p = arr > _;
if (strcmp (p, pNewText) == 0)
found = 1;
}
return found;
}
V. Ivashko
“Markus Jauslin” <> markus.jauslin@ch.mullermartini.com> > wrote in message
news:99u4j3$1fl$> 1@inn.qnx.com> …
Hi all,
I have a PtComboBox as widget with editing enabled and following
callbacks:
- List Item Selected
- Modify Verify
The problem is that modify_verify is also called when the user selects
an
item of the list. Am I assuming right that this is correct behavior
since
the selection modifies the text? Can it be avoided and how? When this
is
not
possible, how can I determine the origin for the modify_verify
callback
so
I
can ignore it and wait for the item_selected callback? Is there a list
of
pending callbacks which can be checked?
Thanks for any pointer or help
Markus_
\