Huw Davies : oledlg: Logic for initial selection of paste/ pastelink radio buttons.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Oct 20 04:45:56 CDT 2006


Module: wine
Branch: master
Commit: a67ad872e3f08090e76f21760cd705bfdfa986f6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a67ad872e3f08090e76f21760cd705bfdfa986f6

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Oct 18 21:42:33 2006 +0100

oledlg: Logic for initial selection of paste/pastelink radio buttons.

---

 dlls/oledlg/pastespl.c |   36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/dlls/oledlg/pastespl.c b/dlls/oledlg/pastespl.c
index cbfd764..47145b2 100644
--- a/dlls/oledlg/pastespl.c
+++ b/dlls/oledlg/pastespl.c
@@ -218,8 +218,40 @@ static DWORD init_linklist(HWND hdlg, OL
 
 static void init_lists(HWND hdlg, ps_struct_t *ps_struct)
 {
-    init_pastelist(hdlg, ps_struct->ps);
-    init_linklist(hdlg, ps_struct->ps);
+    DWORD pastes_added = init_pastelist(hdlg, ps_struct->ps);
+    DWORD links_added = init_linklist(hdlg, ps_struct->ps);
+    UINT check_id, list_id;
+
+    if((ps_struct->flags & (PSF_SELECTPASTE | PSF_SELECTPASTELINK)) == 0)
+        ps_struct->flags |= PSF_SELECTPASTE;
+
+    if(!pastes_added && !links_added)
+        ps_struct->flags &= ~(PSF_SELECTPASTE | PSF_SELECTPASTELINK);
+    else if(!pastes_added && (ps_struct->flags & PSF_SELECTPASTE))
+    {
+        ps_struct->flags &= ~PSF_SELECTPASTE;
+        ps_struct->flags |= PSF_SELECTPASTELINK;
+    }
+    else if(!links_added && (ps_struct->flags & PSF_SELECTPASTELINK))
+    {
+        ps_struct->flags &= ~PSF_SELECTPASTELINK;
+        ps_struct->flags |= PSF_SELECTPASTE;
+    }
+
+    check_id = 0;
+    list_id = 0;
+    if(ps_struct->flags & PSF_SELECTPASTE)
+    {
+        check_id = IDC_PS_PASTE;
+        list_id = IDC_PS_PASTELIST;
+    }
+    else if(ps_struct->flags & PSF_SELECTPASTELINK)
+    {
+        check_id = IDC_PS_PASTELINK;
+        list_id = IDC_PS_PASTELINKLIST;
+    }
+
+    CheckRadioButton(hdlg, IDC_PS_PASTE, IDC_PS_PASTELINK, check_id);
 }
 
 static void update_structure(HWND hdlg, ps_struct_t *ps_struct)




More information about the wine-cvs mailing list