本文整理汇总了C++中Catalog::GetAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ Catalog::GetAttribute方法的具体用法?C++ Catalog::GetAttribute怎么用?C++ Catalog::GetAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog::GetAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: whiteboard
boolean ComEditor::whiteboard() {
if (_whiteboard==-1) {
Catalog* catalog = unidraw->GetCatalog();
const char* wbmaster_str = catalog->GetAttribute("wbmaster");
const char* wbslave_str = catalog->GetAttribute("wbslave");
if (wbmaster_str && strcmp(wbmaster_str, "true")==0 ||
wbslave_str && strcmp(wbslave_str, "true")==0)
_whiteboard = 1;
else
_whiteboard = 0;
}
return _whiteboard;
}
示例2: InitViewer
void FrameKit::InitViewer () {
Catalog* catalog = unidraw->GetCatalog();
const char* page_w = catalog->GetAttribute(page_width_attrib);
const char* page_h = catalog->GetAttribute(page_height_attrib);
const char* page_cols = catalog->GetAttribute(page_cols_attrib);
const char* page_rows = catalog->GetAttribute(page_rows_attrib);
const char* x_incr = catalog->GetAttribute(grid_x_incr);
const char* y_incr = catalog->GetAttribute(grid_y_incr);
GraphicView* view = (GraphicView*)((FrameEditor*)_ed)->_comp->Create(COMPONENT_VIEW);
((FrameEditor*)_ed)->_comp->Attach(view);
view->Update();
Style* style = Session::instance()->style();
boolean bookgeom = style->value_is_on("bookgeom");
float w = bookgeom ? 700 : Math::round(atof(page_w) * ivinches);
float h = bookgeom ? 906 : Math::round(atof(page_h) * ivinches);
if (page_cols && page_rows) {
int ncols = atoi(page_cols);
int nrows = atoi(page_rows);
if (ncols>0 && nrows>0) {
w = ncols;
h = nrows;
}
}
OverlayPage* page = new OverlayPage(w, h);
Grid* grid = new Grid(w, h, atof(x_incr), atof(y_incr));
grid->Visibility(false);
if (!bookgeom)
((FrameEditor*)_ed)->_viewer = new FrameViewer(_ed, view, page, grid);
else
((FrameEditor*)_ed)->_viewer = new FrameViewer(_ed, view, page, grid, (int) h+1, (int) w+1, Rotated);
}
示例3: InitLayout
void FrameKit::InitLayout(OverlayKit* kit, const char* name) {
FrameEditor* ed = (FrameEditor*) kit->GetEditor();
Catalog* catalog = unidraw->GetCatalog();
const char* stripped_string = catalog->GetAttribute("stripped");
boolean stripped_flag = stripped_string ? strcmp(stripped_string, "true")==0 : false;
if (ed->GetWindow() == nil) {
TextObserver* mousedoc_observer = new TextObserver(ed->MouseDocObservable(), "");
WidgetKit& wk = *WidgetKit::instance();
const LayoutKit& layout = *LayoutKit::instance();
PolyGlyph* topbox = layout.vbox();
Glyph* menus = kit->MakeMenus();
Glyph* states = kit->MakeStates();
Glyph* toolbar = kit->MakeToolbar();
if (stripped_flag) {
Target* viewer =
new Target(new Frame(ed->Interior()), TargetPrimitiveHit);
ed->body(viewer);
topbox->append(ed);
} else {
if (states)
menus->append(states);
Target* viewer =
new Target(new Frame(kit->Interior()), TargetPrimitiveHit);
Catalog* catalog = unidraw->GetCatalog();
if (const char* toolbarloca = catalog->GetAttribute("toolbarloc")) {
if (strcmp(toolbarloca, "r") == 0)
toolbar->prepend(layout.vcenter(viewer));
else /* if (strcmp(toolbarloca, "l") == 0) */
toolbar->append(layout.vcenter(viewer));
} else
toolbar->append(layout.vcenter(viewer));
menus->append(toolbar);
Style* style = Session::instance()->style();
boolean bookgeom = style->value_is_on("bookgeom");
ed->body(menus);
ed->GetKeyMap()->Execute(CODE_SELECT);
topbox->append(ed);
if (!bookgeom) {
boolean set_flag = kit->set_button_flag();
boolean clr_flag = kit->clr_button_flag();
EivTextEditor* texteditor = nil;
if(!set_flag && !clr_flag) {
texteditor = new ComTextEditor(wk.style(), ed->comterp());
}
else
texteditor = new EivTextEditor(wk.style());
((FrameEditor*)ed)->_texteditor = texteditor;
Button* set = set_flag ?
wk.push_button("Set", new ActionCallback(FrameEditor)
((FrameEditor*)ed, &FrameEditor::SetText)) :
nil;
Button* clear = clr_flag ?
wk.push_button("Clear", new ActionCallback(FrameEditor)
((FrameEditor*)ed, &FrameEditor::ClearText)) :
nil;
Glyph* buttonbox = nil;
if (set && !clear) {
buttonbox =
layout.vbox(layout.hcenter(set));
} else if (!set && clear) {
buttonbox =
layout.vbox(layout.hcenter(clear));
} else if (set && clear) {
buttonbox =
layout.vbox(
layout.hcenter(set),
layout.vspace(10),
layout.hcenter(clear)
);
}
if (buttonbox) {
topbox->append(
wk.outset_frame(
layout.hbox(
layout.vcenter(
layout.margin(
buttonbox,
10
)
),
layout.vcenter(texteditor)
)
)
);
} else {
topbox->append(
wk.outset_frame(
layout.hbox(
layout.vcenter(
layout.margin(
layout.vbox(
#if 0
wk.label("type help"),
//.........这里部分代码省略.........