lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] (no subject)


From: Greg Chicares
Subject: [lmi-commits] (no subject)
Date: Sun, 5 Jun 2016 22:32:33 +0000 (UTC)

branch: master
commit f4b5b2a82d7e83bc5767b3ddedea307c181eee0c
Author: Vadim Zeitlin <address@hidden>
Date:   Sat Jun 4 16:48:12 2016 +0200

    Use wxDirPickerCtrl for preferences dialog print directory field
    
    This is similar to the previous commit and makes it easier for the users to
    select the output directory for the PDF files.
---
 preferences_view.xrc |    5 ++---
 transferor.cpp       |   17 +++++++++++++++++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/preferences_view.xrc b/preferences_view.xrc
index e2c9af5..2582f48 100644
--- a/preferences_view.xrc
+++ b/preferences_view.xrc
@@ -269,10 +269,9 @@
                 </object>
                 <object class="sizeritem">
                     <flag>wxGROW</flag>
-                    <object class="wxTextCtrl" name="PrintDirectory">
-<!-- change soon to:
                     <object class="wxDirPickerCtrl" name="PrintDirectory">
--->
+                        
<style>wxDIRP_DIR_MUST_EXIST|wxDIRP_USE_TEXTCTRL|wxDIRP_SMALL</style>
+                        <message>Choose directory where PDF files are 
written</message>
                         <help>Location where PDF files are written</help>
                         <size>180,-1</size>
                     </object>
diff --git a/transferor.cpp b/transferor.cpp
index 4a5b3d3..0c99f44 100644
--- a/transferor.cpp
+++ b/transferor.cpp
@@ -71,6 +71,7 @@ namespace
     bool Transfer(transfer_direction, std::string&, wxChoice&         );
     bool Transfer(transfer_direction, std::string&, wxComboBox&       );
     bool Transfer(transfer_direction, std::string&, wxDatePickerCtrl& );
+    bool Transfer(transfer_direction, std::string&, wxDirPickerCtrl&  );
     bool Transfer(transfer_direction, std::string&, wxFilePickerCtrl& );
     bool Transfer(transfer_direction, std::string&, wxGauge&          );
     bool Transfer(transfer_direction, std::string&, wxListBox&        );
@@ -150,6 +151,7 @@ bool Transferor::PerformTransfer(transfer_direction td)
     wxComboBox       * combobox     ;
     wxChoice         * choice       ;
     wxDatePickerCtrl * datepicker   ;
+    wxDirPickerCtrl  * dirpicker    ;
     wxFilePickerCtrl * filepicker   ;
     wxGauge          * gauge        ;
     wxListBox        * listbox      ;
@@ -176,6 +178,8 @@ bool Transferor::PerformTransfer(transfer_direction td)
         return Transfer(td, data_,             *choice      );
     else if(nullptr != (datepicker   = dynamic_cast<wxDatePickerCtrl 
*>(control)))
         return Transfer(td, data_,             *datepicker  );
+    else if(nullptr != (dirpicker    = dynamic_cast<wxDirPickerCtrl 
*>(control)))
+        return Transfer(td, data_,             *dirpicker   );
     else if(nullptr != (filepicker   = dynamic_cast<wxFilePickerCtrl 
*>(control)))
         return Transfer(td, data_,             *filepicker  );
     else if(nullptr != (gauge        = dynamic_cast<wxGauge          
*>(control)))
@@ -385,6 +389,19 @@ namespace
         return true;
     }
 
+    bool Transfer(transfer_direction td, std::string& data, wxDirPickerCtrl& 
control)
+    {
+        if(td == from_string_to_control)
+            {
+            control.SetPath(data);
+            }
+        else
+            {
+            data = control.GetPath().ToStdString();
+            }
+        return true;
+    }
+
     bool Transfer(transfer_direction td, std::string& data, wxFilePickerCtrl& 
control)
     {
         if(td == from_string_to_control)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]