Index: JvWizardRouteMapSteps.pas
===================================================================
--- JvWizardRouteMapSteps.pas	(revision 13044)
+++ JvWizardRouteMapSteps.pas	(working copy)
@@ -51,6 +51,7 @@
     FShowDivider: Boolean;
     FShowNavigators: Boolean;
     FShowNavigation: Boolean;
+    FMultiline: Boolean;
     function GetActiveStepRect: TRect;
     function GetPreviousStepRect: TRect;
     function GetNextStepRect: TRect;
@@ -68,6 +69,7 @@
     function StoreNextStepText: Boolean;
     function StorePreviousStepText: Boolean;
     procedure SetShowNavigation(const Value: Boolean);
+    procedure SetMultiline(const Value: Boolean);
   protected
     procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
     function PageAtPos(Pt: TPoint): TJvWizardCustomPage; override;
@@ -81,6 +83,7 @@
     property Indent: Integer read FIndent write SetIndent default 5;
     property PreviousStepText: string read FPreviousStepText write SetPreviousStepText stored StorePreviousStepText;
     property ActiveStepFormat: string read FActiveStepFormat write SetActiveStepFormat stored StoreActiveStepFormat;
+    property Multiline: Boolean read FMultiline write SetMultiline default False;
     property NextStepText: string read FNextStepText write SetNextStepText stored StoreNextStepText;
     property ShowDivider: Boolean read FShowDivider write SetShowDivider default True;
     property ShowNavigators: Boolean read FShowNavigators write SetShowNavigators default True;
@@ -218,93 +221,155 @@
 
 procedure TJvWizardRouteMapSteps.Paint;
 var
-  ARect, TextRect, ArrowRect, DividerRect: TRect;
+  LRect, TextRect, ArrowRect, DividerRect: TRect;
   ActivePageIndex, TotalPageCount: Integer;
   StepHeight: Integer;
   APage: TJvWizardCustomPage;
   S: string;
+  LDrawProperties: Cardinal;
 begin
+  LRect := ClientRect;
+  TotalPageCount := DetectPageCount(ActivePageIndex);
+  Canvas.Brush.Color := Color;
+  if HasPicture then
+    Image.PaintTo(Canvas, LRect);
 
-    ARect := ClientRect;
-    TotalPageCount := DetectPageCount(ActivePageIndex);
-    Canvas.Brush.Color := Color;
-    if HasPicture then
-      Image.PaintTo(Canvas, ARect);
+  TextRect := GetActiveStepRect;
+  LRect := Rect(TextRect.TopLeft, TextRect.BottomRight);
+  Canvas.Font.Assign(Font);
+  Canvas.Font.Style := [fsBold];
+  Canvas.Brush.Style := bsClear;
 
-    TextRect := GetActiveStepRect;
-    Canvas.Font.Assign(Font);
-    Canvas.Font.Style := [fsBold];
-    Canvas.Brush.Style := bsClear;
-
-    S := Format(ActiveStepFormat, [ActivePageIndex, TotalPageCount]);
+  if Multiline then
+  begin
+    S := Pages[PageIndex].Caption;
+    Canvas.Font.Style := [];
     StepHeight := DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
-      DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER);
+      DT_CALCRECT or DT_LEFT or DT_WORDBREAK);
+    TextRect.Right := LRect.Right;
+    OffsetRect(TextRect, 0, Round((-0.5) * StepHeight + Canvas.TextHeight('Wq')));
+  end;
 
+  Canvas.Font.Style := [fsBold];
+  S := Format(ActiveStepFormat, [ActivePageIndex, TotalPageCount]);
+  if Multiline then
+  begin
+    LDrawProperties := DT_LEFT or DT_WORDBREAK;
+  end
+  else
+  begin
+    LDrawProperties := DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER;
+  end;
+  StepHeight := DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
+    LDrawProperties);
+
   // Display Active Page Description
+  Canvas.Font.Style := [];
+  OffsetRect(TextRect, 0, StepHeight);
+  S := Pages[PageIndex].Caption;
+  if Multiline then
+  begin
+    LDrawProperties := DT_LEFT or DT_WORDBREAK;
+  end
+  else
+  begin
+    LDrawProperties := DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER;
+  end;
+  DrawText(Canvas.Handle, PChar(S), Length(S), TextRect, LDrawProperties);
+
+  Canvas.Font.Style := [];
+  if Self.ShowDivider then
+  begin
+    SetRect(DividerRect, Left + Indent, TextRect.Bottom + 5, Width - Indent,
+      TextRect.Bottom + 6);
+    Windows.DrawEdge(Canvas.Handle, DividerRect, EDGE_RAISED, BF_FLAT or BF_BOTTOM);
+  end;
+
+  { do the previous step }
+
+  // YW - Ignore all disabled pages at run time
+  APage := Wizard.FindNextPage(PageIndex, -1, not (csDesigning in ComponentState));
+  if Assigned(APage) and (PageIndex <> -1) and ShowNavigation then
+  begin
+    TextRect := GetPreviousStepRect;
+    ArrowRect := GetPreviousArrowRect;
     Canvas.Font.Style := [];
-    OffsetRect(TextRect, 0, StepHeight);
-    S := Pages[PageIndex].Caption;
-    DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
-      DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER);
-    Canvas.Font.Style := [];
-    if FShowDivider then
+    if ShowNavigators then
     begin
-      SetRect(DividerRect, Left + FIndent, TextRect.Bottom + 5, Width - FIndent,
-        TextRect.Bottom + 6);
-      Windows.DrawEdge(Canvas.Handle, DividerRect, EDGE_RAISED, BF_FLAT or BF_BOTTOM);
+      if TextRect.Left + Indent + ArrowRect.Right - ArrowRect.Left < Width then
+        OffsetRect(TextRect, ArrowRect.Right, 0);
+      if (csDesigning in ComponentState) or (bkBack in Wizard.WizardPages[PageIndex].EnabledButtons) then
+        DrawFrameControl(Canvas.Handle, ArrowRect, DFC_SCROLL,
+          DFCS_SCROLLLEFT or DFCS_FLAT);
     end;
 
-  { do the previous step }
+    S := PreviousStepText;
+    StepHeight := DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
+      DT_LEFT or DT_WORDBREAK or DT_END_ELLIPSIS);
 
-  // YW - Ignore all disabled pages at run time
-    APage := Wizard.FindNextPage(PageIndex, -1, not (csDesigning in ComponentState));
-    if Assigned(APage) and (PageIndex <> -1) and ShowNavigation then
+    OffsetRect(TextRect, 0, StepHeight);
+    S := APage.Caption;
+    if Multiline then
     begin
-      TextRect := GetPreviousStepRect;
-      ArrowRect := GetPreviousArrowRect;
-      Canvas.Font.Style := [];
-      if ShowNavigators then
-      begin
-        if TextRect.Left + FIndent + ArrowRect.Right - ArrowRect.Left < Width then
-          OffsetRect(TextRect, ArrowRect.Right, 0);
-        if (csDesigning in ComponentState) or (bkBack in Wizard.WizardPages[PageIndex].EnabledButtons) then
-          DrawFrameControl(Canvas.Handle, ArrowRect, DFC_SCROLL,
-            DFCS_SCROLLLEFT or DFCS_FLAT);
-      end;
-      S := FPreviousStepText;
-      StepHeight := DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
-        DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER);
-      OffsetRect(TextRect, 0, StepHeight);
-      S := APage.Caption;
       DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
-        DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER);
+        DT_CALCRECT or DT_LEFT or DT_WORDBREAK);
+      TextRect.Right := LRect.Right;
+
+      LDrawProperties := DT_LEFT or DT_WORDBREAK;
+    end
+    else
+    begin
+      LDrawProperties := DT_SINGLELINE or DT_LEFT or DT_END_ELLIPSIS or DT_VCENTER;
     end;
+    DrawText(Canvas.Handle, PChar(S), Length(S), TextRect, LDrawProperties);
+  end;
 
   { do the next step }
 
   // YW - Ignore all disabled pages at run time
-    APage := Wizard.FindNextPage(PageIndex, 1, not (csDesigning in ComponentState));
-    if Assigned(APage) and (PageIndex <> -1) and ShowNavigation then
+  APage := Wizard.FindNextPage(PageIndex, 1, not (csDesigning in ComponentState));
+  if Assigned(APage) and (PageIndex <> -1) and ShowNavigation then
+  begin
+    TextRect := GetNextStepRect;
+    ArrowRect := GetNextArrowRect;
+    Canvas.Font.Style := [];
+    if ShowNavigators then
     begin
-      TextRect := GetNextStepRect;
-      ArrowRect := GetNextArrowRect;
-      Canvas.Font.Style := [];
-      if ShowNavigators then
-      begin
-        OffsetRect(TextRect, ArrowRect.Right, 0);
-        if (csDesigning in ComponentState) or (bkNext in Wizard.WizardPages[PageIndex].EnabledButtons) then
-          DrawFrameControl(Canvas.Handle, ArrowRect, DFC_SCROLL,
-            DFCS_SCROLLRIGHT or DFCS_FLAT);
-      end;
-      S := FNextStepText;
+      OffsetRect(TextRect, ArrowRect.Right, 0);
+      if (csDesigning in ComponentState) or (bkNext in Wizard.WizardPages[PageIndex].EnabledButtons) then
+        DrawFrameControl(Canvas.Handle, ArrowRect, DFC_SCROLL,
+          DFCS_SCROLLRIGHT or DFCS_FLAT);
+    end;
+
+    if Multiline then
+    begin
+      S := APage.Caption;
       StepHeight := DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
-        DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER);
-      OffsetRect(TextRect, 0, StepHeight);
-      S := APage.Caption;
+        DT_CALCRECT or DT_LEFT or DT_WORDBREAK);
+      TextRect.Right := LRect.Right;
+      OffsetRect(TextRect, 0, (-1) * StepHeight + Canvas.TextHeight('Wq'));
+    end;
+
+    S := NextStepText;
+    StepHeight := DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
+      DT_LEFT or DT_WORDBREAK);
+
+    OffsetRect(TextRect, 0, StepHeight);
+    S := APage.Caption;
+    if Multiline then
+    begin
       DrawText(Canvas.Handle, PChar(S), Length(S), TextRect,
-        DT_LEFT or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER);
+        DT_CALCRECT or DT_LEFT or DT_WORDBREAK);
+      TextRect.Right := LRect.Right;
+
+      LDrawProperties := DT_LEFT or DT_WORDBREAK;
+    end
+    else
+    begin
+      LDrawProperties := DT_SINGLELINE or DT_LEFT or DT_END_ELLIPSIS or DT_VCENTER;
     end;
-
+    DrawText(Canvas.Handle, PChar(S), Length(S), TextRect, LDrawProperties);
+  end;
 end;
 
 procedure TJvWizardRouteMapSteps.SetShowDivider(const Value: Boolean);
@@ -325,6 +390,15 @@
   end;
 end;
 
+procedure TJvWizardRouteMapSteps.SetMultiline(const Value: Boolean);
+begin
+  if FMultiline <> Value then
+  begin
+    FMultiline := Value;
+    Invalidate;
+  end;
+end;
+
 procedure TJvWizardRouteMapSteps.SetNextStepText(const Value: string);
 begin
   if FNextStepText <> Value then
