// // Initializing text display values. // void CTextDisplay::SetAll(CString * show_text, char *font_name, LONG font_size, TextAlignment alignment, BOOL bold, BOOL italic, BOOL underline, COLORREF color) { // Update all settings for the displayed text, but do not update the // window until everything has been updated. SetText(show_text, FALSE); SetFontType(font_name, FALSE); SetFontSize(font_size, FALSE); SetTextAlignment(alignment, FALSE); Bold(bold, FALSE); Italic(italic, FALSE); Underline(underline, FALSE); SetTextColor(color, FALSE); // Update the display. RedrawWindow(); }
void FontWindow::MessageReceived(BMessage *msg) { int32 vl,id; msg->FindInt32("be:value",&vl); msg->FindInt32("index",&id); switch(msg->what) { case 5000: { SetFontType(0,id); } break; case 6000: { struct MyGadget *gad; WrkWindow *wi; const char *str0,*str1; if (wi = DefWin) { if(msg->FindString("f0",&str0) == B_OK) { if(msg->FindString("f1",&str1) == B_OK) { if (gad = DefWin->sellist.ItemAt(0)) { strcpy(&gad->FontName[0],str0); strcpy(&gad->FontStyle[0],str1); } else { strcpy(&wi->FontName[0],str0); strcpy(&wi->FontStyle[0],str1); } } } } } break; case 7000: { SetFontType(1,kFontSizeSet[id]); } break; case 8000: { SetFontType(2,id); } break; default: { BWindow::MessageReceived(msg); } break; } }