TitleBar.cxx (ba606a71) | TitleBar.cxx (4e21436d) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 16 unchanged lines hidden (view full) --- 25#include "Paint.hxx" 26 27#include <tools/svborder.hxx> 28#include <vcl/gradient.hxx> 29#include <vcl/lineinfo.hxx> 30 31ToolbarValue::~ToolbarValue (void) {} 32 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 16 unchanged lines hidden (view full) --- 25#include "Paint.hxx" 26 27#include <tools/svborder.hxx> 28#include <vcl/gradient.hxx> 29#include <vcl/lineinfo.hxx> 30 31ToolbarValue::~ToolbarValue (void) {} 32 |
33namespace 34{ 35 const static sal_Int32 gnLeftIconSpace (3); 36 const static sal_Int32 gnRightIconSpace (3); 37} |
|
33 34namespace sfx2 { namespace sidebar { 35 36TitleBar::TitleBar ( 37 const ::rtl::OUString& rsTitle, 38 Window* pParentWindow, 39 const sidebar::Paint& rInitialBackgroundPaint) 40 : Window(pParentWindow), 41 maToolBox(this), | 38 39namespace sfx2 { namespace sidebar { 40 41TitleBar::TitleBar ( 42 const ::rtl::OUString& rsTitle, 43 Window* pParentWindow, 44 const sidebar::Paint& rInitialBackgroundPaint) 45 : Window(pParentWindow), 46 maToolBox(this), |
42 msTitle(rsTitle) | 47 msTitle(rsTitle), 48 maIcon() |
43{ 44 SetBackground(rInitialBackgroundPaint.GetWallpaper()); | 49{ 50 SetBackground(rInitialBackgroundPaint.GetWallpaper()); |
45 | 51 |
46 maToolBox.SetSelectHdl(LINK(this, TitleBar, SelectionHandler)); 47} 48 49 50 51 52TitleBar::~TitleBar (void) 53{ --- 6 unchanged lines hidden (view full) --- 60{ 61 msTitle = rsTitle; 62 Invalidate(); 63} 64 65 66 67 | 52 maToolBox.SetSelectHdl(LINK(this, TitleBar, SelectionHandler)); 53} 54 55 56 57 58TitleBar::~TitleBar (void) 59{ --- 6 unchanged lines hidden (view full) --- 66{ 67 msTitle = rsTitle; 68 Invalidate(); 69} 70 71 72 73 |
74void TitleBar::SetIcon (const Image& rIcon) 75{ 76 maIcon = rIcon; 77 Invalidate(); 78} 79 80 81 82 |
|
68void TitleBar::Paint (const Rectangle& rUpdateArea) 69{ 70 (void)rUpdateArea; 71 72 // Paint title bar background. 73 Size aWindowSize (GetOutputSizePixel()); 74 Rectangle aTitleBarBox( 75 0, --- 56 unchanged lines hidden (view full) --- 132 133 134 135 136void TitleBar::PaintTitle (const Rectangle& rTitleBox) 137{ 138 Push(PUSH_FONT | PUSH_TEXTCOLOR); 139 | 83void TitleBar::Paint (const Rectangle& rUpdateArea) 84{ 85 (void)rUpdateArea; 86 87 // Paint title bar background. 88 Size aWindowSize (GetOutputSizePixel()); 89 Rectangle aTitleBarBox( 90 0, --- 56 unchanged lines hidden (view full) --- 147 148 149 150 151void TitleBar::PaintTitle (const Rectangle& rTitleBox) 152{ 153 Push(PUSH_FONT | PUSH_TEXTCOLOR); 154 |
155 Rectangle aTitleBox (rTitleBox); 156 157 // When there is an icon then paint it at the left of the given 158 // box. 159 if ( !! maIcon) 160 { 161 DrawImage( 162 Point( 163 aTitleBox.Left() + gnLeftIconSpace, 164 aTitleBox.Top() + (aTitleBox.GetHeight()-maIcon.GetSizePixel().Height())/2), 165 maIcon); 166 aTitleBox.Left() += gnLeftIconSpace + maIcon.GetSizePixel().Width() + gnRightIconSpace; 167 } 168 |
|
140 Font aFont(GetFont()); 141 aFont.SetWeight(WEIGHT_BOLD); 142 SetFont(aFont); 143 144 // Paint title bar text. 145 SetTextColor(GetTextColor()); 146 DrawText( | 169 Font aFont(GetFont()); 170 aFont.SetWeight(WEIGHT_BOLD); 171 SetFont(aFont); 172 173 // Paint title bar text. 174 SetTextColor(GetTextColor()); 175 DrawText( |
147 rTitleBox, | 176 aTitleBox, |
148 msTitle, 149 TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER); 150 151 Pop(); 152} 153 154 155 --- 44 unchanged lines hidden --- | 177 msTitle, 178 TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER); 179 180 Pop(); 181} 182 183 184 --- 44 unchanged lines hidden --- |