fix mouse left button issues due to breaking changes
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
#include <cstddef>
|
||||
|
||||
#include <nana/deploy.hpp>
|
||||
|
||||
@@ -160,24 +161,24 @@ namespace filesystem
|
||||
|
||||
struct directory_entry
|
||||
{
|
||||
path m_path;
|
||||
using path_type = filesystem::path;
|
||||
path_type m_path;
|
||||
|
||||
attribute attr{};
|
||||
//file_status m_status;
|
||||
attribute attr{};
|
||||
//file_status m_status;
|
||||
|
||||
directory_entry(){}
|
||||
directory_entry(const nana::string& filename_, bool is_directory, uintmax_t size)
|
||||
:m_path{filename_}, attr{size, is_directory}
|
||||
{}
|
||||
directory_entry(const path_type& p, bool is_directory, uintmax_t size)
|
||||
:m_path{p}, attr{size, is_directory}
|
||||
{}
|
||||
|
||||
void assign (const path& p){ m_path=p;}
|
||||
void replace_filename(const path& p){ m_path=p;}
|
||||
void assign (const path_type& p){ m_path=p;}
|
||||
void replace_filename(const path_type& p){ m_path=p;}
|
||||
|
||||
//file_status status() const;
|
||||
|
||||
operator const path&() const {return m_path;};
|
||||
const path& path() const {return m_path;}
|
||||
//file_status status() const;
|
||||
|
||||
operator const path_type&() const {return m_path;};
|
||||
const path_type& path() const {return m_path;}
|
||||
};
|
||||
|
||||
/// an iterator for a sequence of directory_entry elements representing the files in a directory, not an recursive_directory_iterator
|
||||
@@ -186,10 +187,10 @@ namespace filesystem
|
||||
{
|
||||
public:
|
||||
using value_type = directory_entry ;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef const directory_entry* pointer;
|
||||
typedef const directory_entry& reference;
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef const directory_entry* pointer;
|
||||
typedef const directory_entry& reference;
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
|
||||
directory_iterator():end_(true), handle_(nullptr){}
|
||||
|
||||
@@ -220,8 +221,8 @@ namespace filesystem
|
||||
|
||||
|
||||
// enable directory_iterator range-based for statements
|
||||
directory_iterator begin( ) { return *this; }
|
||||
directory_iterator end( ) { return {}; }
|
||||
directory_iterator begin( ) { return *this; }
|
||||
directory_iterator end( ) { return {}; }
|
||||
|
||||
private:
|
||||
template<typename Char>
|
||||
@@ -285,16 +286,14 @@ namespace filesystem
|
||||
}
|
||||
|
||||
struct stat fst;
|
||||
bool is_directory = false;
|
||||
unsigned size = 0;
|
||||
if(stat((path_ + dnt->d_name).c_str(), &fst) == 0)
|
||||
{
|
||||
value_ = value_type(nana::charset(dnt->d_name), 0 != S_ISDIR(fst.st_mode), fst.st_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
value_.m_path = nana::charset(dnt->d_name);
|
||||
value_.size = 0;
|
||||
value_.directory = false;
|
||||
is_directory = (0 != S_ISDIR(fst.st_mode));
|
||||
size = fst.st_size;
|
||||
}
|
||||
value_ = value_type(static_cast<nana::string>(nana::charset(dnt->d_name)), is_directory, size);
|
||||
end_ = false;
|
||||
}
|
||||
}
|
||||
@@ -342,7 +341,7 @@ namespace filesystem
|
||||
}
|
||||
struct stat fst;
|
||||
if(stat((path_ + "/" + dnt->d_name).c_str(), &fst) == 0)
|
||||
value_ = value_type(wfd_.cFileName,
|
||||
value_ = value_type(static_cast<nana::string>(nana::charset(wfd_.cFileName)),
|
||||
(FILE_ATTRIBUTE_DIRECTORY & wfd_.dwFileAttributes) == FILE_ATTRIBUTE_DIRECTORY,
|
||||
wfd_.nFileSizeLow);
|
||||
else
|
||||
|
||||
@@ -432,6 +432,12 @@ namespace nana
|
||||
bool right_button; ///< mouse right button is pressed?
|
||||
bool shift; ///< keyboard Shift is pressed?
|
||||
bool ctrl; ///< keyboard Ctrl is pressed?
|
||||
|
||||
/// Checks if left button is operated,
|
||||
bool is_left_button() const
|
||||
{
|
||||
return (event_code::mouse_move == evt_code ? left_button : (mouse::left_button == button));
|
||||
}
|
||||
};
|
||||
|
||||
/// in arg_wheel event_code is event_code::mouse_wheel
|
||||
|
||||
@@ -235,9 +235,9 @@ namespace nana{ namespace widgets
|
||||
nana::upoint caret() const;
|
||||
bool scroll(bool upwards, bool vertical);
|
||||
bool mouse_enter(bool);
|
||||
bool mouse_down(bool left_button, const point& screen_pos);
|
||||
bool mouse_down(::nana::mouse, const point& screen_pos);
|
||||
bool mouse_move(bool left_button, const point& screen_pos);
|
||||
bool mouse_up(bool left_button, const point& screen_pos);
|
||||
bool mouse_up(::nana::mouse, const point& screen_pos);
|
||||
|
||||
skeletons::textbase<nana::char_t>& textbase();
|
||||
const skeletons::textbase<nana::char_t>& textbase() const;
|
||||
|
||||
Reference in New Issue
Block a user