void HeaderView::PrintHeaderAction(RenderDescriptor renderDescriptor, wstring actionDescription, wstring actionText, Subscribeable<>* actionCallback) { TextRenderResult originLineRenderResult = renderDescriptor.GetRenderer()->PrintText( StringUtilities::Format(L" (%ls ", actionDescription.c_str()), FontSmall, Colors::Gray, renderDescriptor.GetRenderPosition()); HoverTextButtonControl* headerActionButton = new HoverTextButtonControl(Context, this); headerActionButton->SetFont(FontSmallUnderscored); headerActionButton->SetPosition(originLineRenderResult.GetRenderPosition().MoveY(-FontSmall->GetAscent()).GetPosition()); headerActionButton->SetText(actionText); headerActionButton->OnClick.Subscribe(actionCallback); headerActionButton->InitializeAndRender(); renderDescriptor.GetRenderer()->PrintText( L")", FontSmall, Colors::Gray, Point(headerActionButton->GetBoundingRect().GetRight(), originLineRenderResult.GetBaselineY())); }
RenderPosition::RenderPosition(TextRenderResult textRenderResult) { position = textRenderResult.GetRight(); }
RenderDescriptor::RenderDescriptor(Renderer* renderer, TextRenderResult textRenderResult) : RenderDescriptor(renderer, textRenderResult.GetRenderPosition()) { }