本文整理汇总了C++中UAS_Pointer::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ UAS_Pointer::parent方法的具体用法?C++ UAS_Pointer::parent怎么用?C++ UAS_Pointer::parent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UAS_Pointer
的用法示例。
在下文中一共展示了UAS_Pointer::parent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MapButton
void
MapAgent::display (UAS_Pointer<UAS_Common> &doc_ptr, bool popup)
{
static bool first_time = True;
u_int i, num_children;
MapButton *parent_button, *child_button, *this_button = NULL;
if (f_shell == NULL)
create_ui();
// Just pop up the window if the map has already been created
// for the specified document.
if (doc_ptr == f_doc_ptr)
{
if (popup) {
f_shell->Popup();
XMapRaised(XtDisplay(*f_shell), XtWindow(*f_shell));
}
f_onscreen = TRUE;
return;
}
// Must have to create a new tree, so start by wiping out the old one.
if (f_tree != NULL)
{
f_tree->Destroy();
delete f_tree;
}
f_tree = new WXawTree (*f_porthole, "tree");
// f_tree->Realize();
// Tree gravity should be a preference that is retrieved right here.
// (Or better yet stored in the class record.)
/* -------- Start the local map at this node's parent. -------- */
UAS_Pointer<UAS_Common> toc_this = doc_ptr;
UAS_Pointer<UAS_Common> toc_parent =
(doc_ptr != (UAS_Pointer<UAS_Common>)0)
? doc_ptr->parent() : (UAS_Pointer<UAS_Common>)0;
// If the entry has a parent, create a button for it and each of
// the entry's siblings.
if (toc_parent != (UAS_Pointer<UAS_Common>)NULL)
{
parent_button = new MapButton (*f_tree, toc_parent, NULL);
// parent_button->expand();
/* -------- Create a button for each sibling. -------- */
UAS_List<UAS_Common> kids = toc_parent->children();
num_children = kids.length();
UAS_Pointer<UAS_Common> toc_kid;
for (i = 0; i < num_children; i++)
{
toc_kid = kids[i];
child_button = new MapButton (*f_tree, toc_kid, parent_button);
if (toc_kid == doc_ptr)
{
f_doc_ptr = doc_ptr;
this_button = child_button;
}
}
}
else // No TOC parent -- SWM: Also may be no TOC!!!
{
f_doc_ptr = doc_ptr;
this_button = new MapButton (*f_tree, toc_this, NULL);
}
if (this_button == NULL)
{
message_mgr().
error_dialog (CATGETS(Set_Messages, 7, "File a Bug"));
return;
}
else
{
static bool first_time = TRUE;
static Pixel highlight_bg, highlight_fg;
if (first_time)
{
const char *s;
unsigned long status;
s = window_system().get_string_default ("MapHighlightBackground");
if (s == NULL || *s == '\0')
{
highlight_bg = this_button->f_button.Foreground();
}
else
{
status = window_system().get_color (s, highlight_bg);
// On failure to allocate, just invert.
if (status == 0)
{
highlight_bg = this_button->f_button.Foreground();
highlight_fg = this_button->f_button.Background();
}
// Got bg, so now try for fg.
else
//.........这里部分代码省略.........