void Operation::draw_patient_info(const Glib::RefPtr<Gtk::PrintContext>& print) { Cairo::RefPtr<Cairo::Context> cairo = print->get_cairo_context(); Glib::RefPtr<Pango::Layout> layout = print->create_pango_layout(); Pango::FontDescription font_desc("sans 12"); layout->set_font_description(font_desc); layout->set_width(width_ * Pango::SCALE); DICOM::SummaryInfo* info = const_cast<DICOM::SummaryInfo*>(&dicom_info_); DICOM::PatientInfo* patient = info->get_patient_info(); //Set and mark up the text to print: Glib::ustring marked_up_form_text; Glib::ustring txt = DICOM::format_person_name(patient->get_name()); marked_up_form_text += "<b>Patient's name</b>: " + txt + "\n"; marked_up_form_text += "<b>Sex</b>: " + info->get_patient_sex() + "\n"; DICOM::PatientAge age = info->get_patient_age(); marked_up_form_text += "<b>Age</b>: " + age.age_string() + "\n\n"; layout->set_markup(marked_up_form_text); layout->show_in_cairo_context(cairo); int w, h; layout->get_pixel_size( w, h); cairo->rel_move_to( 0, h); cairo->stroke_preserve(); }
void AppMainWindow::InitializeComponents () { mController->get_signal_message().connect (sigc::mem_fun (*this, &AppMainWindow::on_message_changed)); Pango::FontDescription font_desc ("serif 22"); font_desc.set_weight (Pango::WEIGHT_BOLD); Gdk::Color cl ("black"); mMsgLabel.modify_font(font_desc); mMsgLabel.modify_fg (Gtk::STATE_NORMAL, cl); mMsgLabel.set_text ("Waiting for card insertion"); mFrame.add (mMsgLabel); this->add (mFrame); this->set_default_size (700, 400); this->set_position (Gtk::WIN_POS_CENTER); this->show_all_children (); }
void Operation::draw_study_info(const Glib::RefPtr<Gtk::PrintContext>& print) { Cairo::RefPtr<Cairo::Context> cairo = print->get_cairo_context(); Glib::RefPtr<Pango::Layout> layout = print->create_pango_layout(); Pango::FontDescription font_desc("sans 12"); layout->set_font_description(font_desc); layout->set_width(width_ * Pango::SCALE); DICOM::SummaryInfo* info = const_cast<DICOM::SummaryInfo*>(&dicom_info_); DICOM::StudyInfo* study = info->get_study_info(); //Set and mark up the text to print: Glib::ustring marked_up_form_text = "<b>Study ID</b>: " + study->get_id() + "\n"; layout->set_markup(marked_up_form_text); layout->show_in_cairo_context(cairo); cairo->stroke(); Glib::ustring txt = DICOM::format_person_name(study->get_operator_name()); marked_up_form_text = "<b>Operator's name</b>: " + txt + "\t\t\t\n"; txt = DICOM::format_person_name(study->get_physician_name()); marked_up_form_text += "<b>Physician's name</b>: " + txt + "\t\t\t\n"; layout->set_markup(marked_up_form_text); int w, h; layout->get_pixel_size( w, h); cairo->move_to( width_ - w, height_ - h); layout->show_in_cairo_context(cairo); cairo->stroke(); }