+        DrawFrameBackground(dc, rect, flags);
+        if ( flags & wxTOPLEVEL_ICON )
+            DrawFrameIcon(dc, rect, icon, flags);
+        DrawFrameTitle(dc, rect, title, flags);
+
+        wxRect client = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
+        wxCoord x,y;
+        x = client.GetRight() - 2 - FRAME_BUTTON_WIDTH;
+        y = client.GetTop() + (FRAME_TITLEBAR_HEIGHT-FRAME_BUTTON_HEIGHT)/2;
+
+        if ( flags & wxTOPLEVEL_BUTTON_CLOSE )
+        {
+            DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_CLOSE,
+                            (specialButton == wxTOPLEVEL_BUTTON_CLOSE) ?
+                            specialButtonFlags : 0);
+            x -= FRAME_BUTTON_WIDTH + 2;
+        }
+        if ( flags & wxTOPLEVEL_BUTTON_MAXIMIZE )
+        {
+            DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_MAXIMIZE,
+                            (specialButton == wxTOPLEVEL_BUTTON_MAXIMIZE) ?
+                            specialButtonFlags : 0);
+            x -= FRAME_BUTTON_WIDTH;
+        }
+        if ( flags & wxTOPLEVEL_BUTTON_RESTORE )
+        {
+            DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_RESTORE,
+                            (specialButton == wxTOPLEVEL_BUTTON_RESTORE) ?
+                            specialButtonFlags : 0);
+            x -= FRAME_BUTTON_WIDTH;
+        }
+        if ( flags & wxTOPLEVEL_BUTTON_ICONIZE )
+        {
+            DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_ICONIZE,
+                            (specialButton == wxTOPLEVEL_BUTTON_ICONIZE) ?
+                            specialButtonFlags : 0);
+            x -= FRAME_BUTTON_WIDTH;
+        }
+        if ( flags & wxTOPLEVEL_BUTTON_HELP )
+        {
+            DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_HELP,
+                            (specialButton == wxTOPLEVEL_BUTTON_HELP) ?
+                            specialButtonFlags : 0);
+        }