Example #1
0
//
/// Sets the text for the default text message gadget by specifying the id.
//
void
TMessageBar::SetMessageText(int id, const tstring& text)
{
  TTextGadget* tg = TYPESAFE_DOWNCAST(GadgetWithId(id), TTextGadget);
  if (tg)
    tg->SetText(text.c_str());
}
Example #2
0
//
/// Constructs a TMessageBar object with the gadget window font. Sets IDW_STATUSBAR,
/// HighlightLine to true, and TTextGadget's member WideAsPossible to true, making
/// the text gadget as wide as the window.
//
TMessageBar::TMessageBar(TWindow* parent, TFont* font, TModule* module)
:
  TGadgetWindow(parent, Horizontal, font ? font : createMsgBarFont(), module)
{
  TTextGadget* textGadget = new TTextGadget(IDG_MESSAGE, TTextGadget::Recessed,
    TTextGadget::Left, 10, 0, 0);

  Attr.Id = IDW_STATUSBAR;

  // 3d UI will bevel the client's inner edge, so we dont need the hilight
  //
  HighlightLine = false;
  textGadget->SetWideAsPossible();
  Insert(*textGadget);
}
Example #3
0
//
// Update the information displayed on the control bar of the 
// preview frame window.
// NOTE: This method simply updates the page info. Derived classes
//       can display additional information.
//
void 
TPreviewWin::UpdateSpeedBar()
{
  // Update the page count.
  //
  TTextGadget* pgGadget = TYPESAFE_DOWNCAST(
                                 PreviewSpeedBar->GadgetWithId(IDB_CURRPAGE),
                                 TTextGadget);
  if (pgGadget) {
    tchar buffer[32];
#if BI_MSG_LANGUAGE == 0x0411
      sprintf(buffer, "Íß°¼Þ %d - %d", Page1->GetPageNumber(),
                                       Page2->GetPageNumber());
    else
      sprintf(buffer, "Íß°¼Þ %d", Page1->GetPageNumber());
#else
    if (Page2 && Page2->GetPageNumber())
      _stprintf(buffer, _T("Page %d - %d"), Page1->GetPageNumber(),
                                      Page2->GetPageNumber());
    else
      _stprintf(buffer, _T("Page %d"), Page1->GetPageNumber());
#endif
    pgGadget->SetText(buffer);
  }