]> Shamusworld >> Repos - apple2/blobdiff - src/gui/window.cpp
diskwindow is *almost* usable!
[apple2] / src / gui / window.cpp
index 9298cf97bc90d6be27d5e311ebdba384ba009ad0..28c0212a4b6466ab350993823f3523ccafb4b8c8 100755 (executable)
@@ -52,7 +52,7 @@ Window::Window(uint32 x/*= 0*/, uint32 y/*= 0*/, uint32 w/*= 0*/, uint32 h/*= 0*
        cbDown(SDL_CreateRGBSurfaceFrom(&closeBoxDown[4], cbWidth, cbHeight, 32, cbWidth * 4,
                MASK_R, MASK_G, MASK_B, MASK_A)),
        cbHover(SDL_CreateRGBSurfaceFrom(&closeBoxHover[4], cbWidth, cbHeight, 32, cbWidth * 4,
-               MASK_R, MASK_G, MASK_B, MASK_A))
+               MASK_R, MASK_G, MASK_B, MASK_A)), drawBackground(true)
 {
 //Could probably move this into the initializer list as well...
 //     closeButton = new Button(w - (cbWidth + 1), 1, cbUp, cbHover, cbDown, this);
@@ -130,9 +130,14 @@ void Window::Draw(void)
        for(uint32 i=0; i<list.size(); i++)
                list[i]->Draw();
 #else
-       // These are *always* top level and parentless, so no need to traverse up through
-       // the parent chain...
-       SDL_FillRect(screen, &extents, bgColor);
+       if (drawBackground)
+       {
+               // These are *always* top level and parentless, so no need to traverse up through
+               // the parent chain...
+               SDL_FillRect(screen, &extents, bgColor);
+       }
+       else
+               RestoreScreenFromBackstore();
 
        // Handle the items this window contains...
        for(uint32 i=0; i<list.size(); i++)
@@ -171,3 +176,8 @@ void Window::AddCloseButton(void)
                list.push_back(closeButton);
        }
 }
+
+void Window::SetBackgroundDraw(bool state)
+{
+       drawBackground = state;
+}