-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce command to share with menu and toolbar #609
base: develop-1.8
Are you sure you want to change the base?
Conversation
First of all, thanks for your efforet, very good idea!
Because
What does
Yes, the renderer is cloneable. We can make tiny changes based on the current renderer just with a small piece of code.
Sorry, I don't understand, would you please explain it. |
oh, sorry, I just wanted to know how
yes, something like that is a good solution! It is not trivial to have a really good solution. I only implemented the simplest possibility, and then, maybe, you will have some day time to make it better! I will try to implement a few more details, but for a robust design one need more experience.
My bad. I mean that a sub- |
# Conflicts: # build/vc2022/nana.vcxproj # build/vc2022/nana.vcxproj.filters
Hi,
The goal of this PR is to:
Introduce command to share with menu, toolbar, button and checkbox
please, compare: widget_show2 manual item creation
with: widget_show2 created with command
This is my first version, and you will need to review and redesign a few thing in it, but I hope this is the first draft of what we wanted. Maybe the correct way is to create a command "interface" to add to any of the supported classes?
First just I will try to compare/document the possible affected parts:
menu
vs.toolbar
:toolbar is a widget, menu - not.
menu
: hold a plain ptr to animplement
which use structures in adrawerbase::menu
namespace.The later includes a
menu_type
,menu_item_type
, and the enumchecks
,menu_item_type
hold a plain pointer to amenu_type
and all the state-data of the item which can be acceded with anitem_proxy
which hold a pointer to themenu
and the position order of the item.A new item can be added with
menu::append
ormenu::insert
.toolbar
: thedrawer
hold a plain pointer to adrawer_impl_type
that hold anitem_container
oftoolbar_item
s. The later hold the state-data.A new item can be added with
toolbar::append
or withitem_proxy::dropdown_append
.button
: is awidget_object
class, which hold aDrawerTrigger
, a sharedEvents
and anscheme_type
scheme_
. The state-data is hold deeper in the windows structure (like the caption), and in these members. TheDrawerTrigger
holds aunique_ptr<impl>
that haveattributes
where the state-dataimage
,focused
,pushed
, etc are.checkbox
: is awidget_object
class, which hold aDrawerTrigger
, a sharedEvents
and anscheme_type
scheme_
. The state-data is hold deeper in the windows structure (like the caption), and in these members. TheDrawerTrigger
holds aunique_ptr<implement>
that haveelement::crook_interface::data data_;
where the state-datacheck_state { unchecked, checked, partial }
,radio
, etc are.Implement/use
checks
/tools
create
command
: a no-widget class, wich state-data useful to set and to sharemenu
,toolbar
,button
andcheckbox
image
(a shared type),image
Make menu and toolbar API similar:
menu
:menu_type
menu_item_type
<---- real data here (generalize?)shared_command
shared_command
(to be used by other constructors)shared_command
(to be used by other constructors)image
toolbar_item
<---- real data heretype, text, image and event
shared_command
shared_command
shared_command
(to be used by other constructors)dropdown_item
<---- real data heretype, text, image and event
shared_command
shared_command
shared_command
(to be used by other constructors)item_proxy& dropdown_append(shared_command command);
item_proxy append(tools t, shared_command command);
void insert(size_type pos, tools type, shared_command command)
item_proxy
void push_back(tools type, shared_command command)
item_proxy
dropdown_item
construct take amenu
and vice ferse?button
:shared_command
type, text, image and event
shared_command
shared_command
shared_command
(to be used by other constructors)checkbox
:shared_command
shared_command
(to be used by other constructors)