comparison dwt/graphics/TextLayout.d @ 214:a8fed3e56433

Fix link error and added missing switch defaults
author Frank Benoit <benoit@tionex.de>
date Sat, 17 May 2008 19:23:59 +0200
parents 36f5cb12e1a2
children b74b74ce5c7d
comparison
equal deleted inserted replaced
213:36f5cb12e1a2 214:a8fed3e56433
1002 Gdip.Pen_SetDashStyle(pen, dashStyle); 1002 Gdip.Pen_SetDashStyle(pen, dashStyle);
1003 Gdip.Graphics_DrawLine(cast(Gdip.Graphics)graphics, pen, runX, underlineY, runX + run.width, underlineY); 1003 Gdip.Graphics_DrawLine(cast(Gdip.Graphics)graphics, pen, runX, underlineY, runX + run.width, underlineY);
1004 Gdip.Pen_delete(pen); 1004 Gdip.Pen_delete(pen);
1005 break; 1005 break;
1006 } 1006 }
1007 default:
1007 } 1008 }
1008 if (brush !is color) Gdip.SolidBrush_delete(cast(Gdip.SolidBrush)brush); 1009 if (brush !is color) Gdip.SolidBrush_delete(cast(Gdip.SolidBrush)brush);
1009 } 1010 }
1010 if (style.strikeout) { 1011 if (style.strikeout) {
1011 if (style.strikeoutColor !is null) { 1012 if (style.strikeoutColor !is null) {
1106 OS.LineTo(graphics, rect.right, rect.top); 1107 OS.LineTo(graphics, rect.right, rect.top);
1107 OS.SelectObject(graphics, oldPen); 1108 OS.SelectObject(graphics, oldPen);
1108 OS.DeleteObject(pen); 1109 OS.DeleteObject(pen);
1109 break; 1110 break;
1110 } 1111 }
1112 default:
1111 } 1113 }
1112 } 1114 }
1113 if (style.strikeout) { 1115 if (style.strikeout) {
1114 if (style.strikeoutColor !is null) { 1116 if (style.strikeoutColor !is null) {
1115 colorRefStrikeout = style.strikeoutColor.handle; 1117 colorRefStrikeout = style.strikeoutColor.handle;
1186 int lineStyle = Gdip.DashStyleSolid; 1188 int lineStyle = Gdip.DashStyleSolid;
1187 switch (style.borderStyle) { 1189 switch (style.borderStyle) {
1188 case DWT.BORDER_SOLID: break; 1190 case DWT.BORDER_SOLID: break;
1189 case DWT.BORDER_DASH: lineStyle = Gdip.DashStyleDash; break; 1191 case DWT.BORDER_DASH: lineStyle = Gdip.DashStyleDash; break;
1190 case DWT.BORDER_DOT: lineStyle = Gdip.DashStyleDot; break; 1192 case DWT.BORDER_DOT: lineStyle = Gdip.DashStyleDot; break;
1193 default:
1191 } 1194 }
1192 auto pen = Gdip.Pen_new(cast(Gdip.Brush)brush, lineWidth); 1195 auto pen = Gdip.Pen_new(cast(Gdip.Brush)brush, lineWidth);
1193 Gdip.Pen_SetDashStyle(pen, lineStyle); 1196 Gdip.Pen_SetDashStyle(pen, lineStyle);
1194 float gdipXOffset = 0.5f, gdipYOffset = 0.5f; 1197 float gdipXOffset = 0.5f, gdipYOffset = 0.5f;
1195 Gdip.Graphics_TranslateTransform(cast(Gdip.Graphics)graphics, gdipXOffset, gdipYOffset, Gdip.MatrixOrderPrepend); 1198 Gdip.Graphics_TranslateTransform(cast(Gdip.Graphics)graphics, gdipXOffset, gdipYOffset, Gdip.MatrixOrderPrepend);
1233 int lineStyle = OS.PS_SOLID; 1236 int lineStyle = OS.PS_SOLID;
1234 switch (style.borderStyle) { 1237 switch (style.borderStyle) {
1235 case DWT.BORDER_SOLID: break; 1238 case DWT.BORDER_SOLID: break;
1236 case DWT.BORDER_DASH: lineStyle = OS.PS_DASH; break; 1239 case DWT.BORDER_DASH: lineStyle = OS.PS_DASH; break;
1237 case DWT.BORDER_DOT: lineStyle = OS.PS_DOT; break; 1240 case DWT.BORDER_DOT: lineStyle = OS.PS_DOT; break;
1241 default:
1238 } 1242 }
1239 LOGBRUSH logBrush; 1243 LOGBRUSH logBrush;
1240 logBrush.lbStyle = OS.BS_SOLID; 1244 logBrush.lbStyle = OS.BS_SOLID;
1241 logBrush.lbColor = cast(uint)color; 1245 logBrush.lbColor = cast(uint)color;
1242 auto newPen = OS.ExtCreatePen(lineStyle | OS.PS_GEOMETRIC, Math.max(1, lineWidth), &logBrush, 0, null); 1246 auto newPen = OS.ExtCreatePen(lineStyle | OS.PS_GEOMETRIC, Math.max(1, lineWidth), &logBrush, 0, null);