Skip to content

Commit

Permalink
Developing 0.22.0
Browse files Browse the repository at this point in the history
- new theme
- improved ADI weight management
- textbox: added focus_behavior and scheme
- toolbar: added tooltype, toggle and toggle_group
- fixed bug on toolbar code generation
- fixed bug on inherited bgcolor and fgcolor propagation
  • Loading branch information
besh81 committed Sep 16, 2019
1 parent abf40ce commit ccc2e39
Show file tree
Hide file tree
Showing 28 changed files with 360 additions and 231 deletions.
4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Click here to download the win exe file: [![Download nana-creator](https://img.shields.io/sourceforge/dt/nana-creator.svg)](https://sourceforge.net/projects/nana-creator/files/latest/download)

<img src="https://besh81.github.io/nana-creator-docs/img/calc.jpg" alt="Calculator UI" width="80%"></a>
<img src="https://besh81.github.io/nana-creator-docs/img/calc.jpg" alt="Calculator UI" width="48%"></a> <img src="https://besh81.github.io/nana-creator-docs/img/adi.jpg" alt="Calculator UI" width="48%"></a>


#### Used libraries:
Expand All @@ -18,4 +18,4 @@ Here the instruction to [Configure-Third-Party-Libraries-for-Nana](https://githu


### Tutorials
- [Basic tutorial](https://besh81.github.io/nana-creator-docs/Basic_Tutorial.html)
- [Basic tutorial](https://besh81.github.io/nana-creator-docs/Basic_Tutorial.html)
9 changes: 8 additions & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


#define CREATOR_NAME "Nana Creator"
#define CREATOR_VERSION "0.21.0"
#define CREATOR_VERSION "0.22.0"



Expand Down Expand Up @@ -74,6 +74,7 @@
#define CAT_LAYOUT "Layout"
#define CAT_FONT "Font"
#define CAT_SCHEME "Scheme"
#define CAT_TYPE "Type"


// choices
Expand All @@ -99,6 +100,12 @@
//
#define CITEM_INCLUDE_1 "#include <>"
#define CITEM_INCLUDE_2 "#include \"\""
//
#define CITEM_FOCUS_NONE "none"
#define CITEM_FOCUS_SEL "select"
#define CITEM_FOCUS_TAB "select_if_tabstop"
#define CITEM_FOCUS_CLICK "select_if_click"
#define CITEM_FOCUS_TAB_CLICK "select_if_tabstop_or_click"


// code-generator
Expand Down
11 changes: 5 additions & 6 deletions src/creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,10 @@ void creator::_init_ctrls()


// adi
_adi_panel.create(*this);
_place["adi_panel"] << _adi_panel;


_adi_place.bind(_adi_panel);
//
_adi_place.scheme().caption_bg = nana::color(64, 86, 141);
_adi_place.scheme().caption_highlight = nana::color(200, 92, 92);

nana::paneinfo pinfo;

Expand All @@ -289,8 +288,8 @@ void creator::_init_ctrls()
nana::paneinfo piC("C");
piC.show_caption(false);
piC.center(true);
piC.weightXXX(55);
_adi_place.add_pane(canvas, nana::dockposition::right, piC);
piC.weight(55);
_adi_place.add_pane(piC, canvas, nana::dockposition::right);

auto properties = new propertiespanel(_adi_panel);
pinfo = _adi_place.add_pane("P", properties, nana::dockposition::right, "Properties");
Expand Down
47 changes: 37 additions & 10 deletions src/creator.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*****************************************************
* C++ code generated with Nana Creator (0.20.0)
* C++ code generated with Nana Creator (0.22.0)
* GitHub repo: https://github.com/besh81/nana-creator
*
* PLEASE EDIT ONLY INSIDE THE TAGS:
Expand All @@ -14,10 +14,10 @@
#include <nana/gui.hpp>
#include <nana/gui/place.hpp>
#include <nana/gui/widgets/toolbar.hpp>
#include <nana/gui/widgets/panel.hpp>
#include <nana/gui/widgets/label.hpp>

//<*includes
#include <nana/gui/widgets/panel.hpp>
#include "nana_extra/adi_place.hpp"
//*>

Expand Down Expand Up @@ -47,19 +47,21 @@ class creator
private:
void init_()
{
//_place.div("vert <weight=30 toolbar><<vert weight=20% <assets>|<objects>>|<weight=55% canvas>|<properties>><weight=24 margin=3 statusbar>");
_place.div("vert <weight=30 toolbar><adi_panel><weight=24 margin=3 statusbar>");
_place.div("vert arrange=[30,variable,24] _field_");
caption("Nana Creator");
bgcolor(nana::color(93,107,153));
// _tb
_tb.create(*this);
_place["toolbar"] << _tb;
_place["_field_"] << _tb;
_tb.bgcolor(nana::color(204,213,240));
_tb.scale(21);
_tb.append("New project", nana::paint::image("icons/new_prj.png"));
_tb.append("Load project", nana::paint::image("icons/load_prj.png"));
_tb.append("Save project", nana::paint::image("icons/save.png"));
_tb.append("Save project as...", nana::paint::image("icons/save_as.png"));
_tb.separate();
_tb.append("Generate C++ code", nana::paint::image("icons/output_on.png"));
_tb.append("Generate code", nana::paint::image("icons/output.png"));
_tb.textout(5, true);
_tb.separate();
_tb.append("Delete current selection", nana::paint::image("icons/delete.png"));
_tb.separate();
Expand All @@ -70,19 +72,45 @@ class creator
_tb.append("Copy current selection", nana::paint::image("icons/copy.png"));
_tb.append("Paste into/after current selection", nana::paint::image("icons/paste.png"));
_tb.go_right();
_tb.append("About...", nana::paint::image("icons/info.png"));
_tb.append("Info...", nana::paint::image("icons/info.png"));
_tb.textout(15, true);
// _adi_panel_margin
_adi_panel_margin.create(*this);
_adi_panel_margin_place.bind(_adi_panel_margin);
_adi_panel_margin_place.div("margin=5 gap=2 _field_");
_adi_panel_margin.bgcolor(this->bgcolor());
_place["_field_"] << _adi_panel_margin;
// _adi_panel
_adi_panel.create(_adi_panel_margin);
_adi_panel.bgcolor(_adi_panel_margin.bgcolor());
_adi_panel_margin_place["_field_"] << _adi_panel;
// _sb_panel
_sb_panel.create(*this);
_sb_panel_place.bind(_sb_panel);
_sb_panel_place.div("weight=24 margin=3 gap=2 _field_");
_sb_panel.bgcolor(nana::color(64,86,141));
_place["_field_"] << _sb_panel;
// _sb
_sb.create(*this);
_place["statusbar"] << _sb;
_sb.create(_sb_panel);
_sb_panel_place["_field_"] << _sb;
_sb.bgcolor(_sb_panel.bgcolor());
_sb.fgcolor(nana::color(255,255,255));
_sb.caption("");

_place.collocate();
_adi_panel_margin_place.collocate();
_sb_panel_place.collocate();
}


protected:
nana::place _place{ *this };
nana::toolbar _tb;
nana::panel<true> _adi_panel_margin;
nana::place _adi_panel_margin_place;
nana::panel<true> _adi_panel;
nana::panel<true> _sb_panel;
nana::place _sb_panel_place;
nana::label _sb;


Expand All @@ -101,7 +129,6 @@ class creator
void _init_ctrls();
void _destroy_ctrls();

nana::panel<true> _adi_panel;
nana::adi_place _adi_place;
//*>
};
Expand Down
64 changes: 27 additions & 37 deletions src/creator.ncp
Original file line number Diff line number Diff line change
@@ -1,40 +1,30 @@
<?xml version="1.0"?>
<nana-creator version="0.20.0">
<form mainclass="true" filename="creator" rel_path="true" work_dir="c:/cppprojects/nana-creator/wdir" type="form" name="creator" enabled="true" caption="Nana Creator" width="800" height="500" bgcolor="212,208,200" fgcolor="0,0,0" decoration="true" taskbar="true" floating="false" no_activate="false" min="true" max="true" sizable="true" layout="1" margin="0" gap="0">
<field type="field" name="toolbar" weight="30" layout="0" margin="0" gap="0">
<toolbar type="toolbar" name="_tb" enabled="true" bgcolor="212,208,200" fgcolor="0,0,0" f_size="9" f_weight="400" f_italic="false" f_underline="false" f_strike_out="false" weight="-1" buttons="(Collection)" scale="21">
<item type="button" key="n1" owner="" text="New project" image="C:\cppprojects\nana-creator\wdir\icons\new_prj.png" enable="true" separator="false" goright="false" />
<item type="button" key="n2" owner="" text="Load project" image="C:\cppprojects\nana-creator\wdir\icons\load_prj.png" enable="true" separator="false" goright="false" />
<item type="button" key="n3" owner="" text="Save project" image="C:\cppprojects\nana-creator\wdir\icons\save.png" enable="true" separator="false" goright="false" />
<item type="button" key="n4" owner="" text="Save project as..." image="C:\cppprojects\nana-creator\wdir\icons\save_as.png" enable="true" separator="false" goright="false" />
<item type="button" key="n5" owner="" text="-----" image="" enable="true" separator="true" goright="false" />
<item type="button" key="n6" owner="" text="Generate C++ code" image="C:\cppprojects\nana-creator\wdir\icons\output_on.png" enable="true" separator="false" goright="false" />
<item type="button" key="n7" owner="" text="-----" image="" enable="true" separator="true" goright="false" />
<item type="button" key="n8" owner="" text="Delete current selection" image="C:\cppprojects\nana-creator\wdir\icons\delete.png" enable="true" separator="false" goright="false" />
<item type="button" key="n9" owner="" text="-----" image="" enable="true" separator="true" goright="false" />
<item type="button" key="n10" owner="" text="Move up current selection" image="C:\cppprojects\nana-creator\wdir\icons\up.png" enable="true" separator="false" goright="false" />
<item type="button" key="n11" owner="" text="Move down current selection" image="C:\cppprojects\nana-creator\wdir\icons\down.png" enable="true" separator="false" goright="false" />
<item type="button" key="n12" owner="" text="-----" image="" enable="true" separator="true" goright="false" />
<item type="button" key="n13" owner="" text="Cut current selection" image="C:\cppprojects\nana-creator\wdir\icons\cut.png" enable="true" separator="false" goright="false" />
<item type="button" key="n14" owner="" text="Copy current selection" image="C:\cppprojects\nana-creator\wdir\icons\copy.png" enable="true" separator="false" goright="false" />
<item type="button" key="n15" owner="" text="Paste into/after current selection" image="C:\cppprojects\nana-creator\wdir\icons\paste.png" enable="true" separator="false" goright="false" />
<item type="button" key="n16" owner="" text="&gt;&gt;&gt; Go right &gt;&gt;&gt;" image="" enable="true" separator="false" goright="true" />
<item type="button" key="n19" owner="" text="Info..." image="C:\cppprojects\nana-creator\wdir\icons\info.png" enable="true" separator="false" goright="false" />
</toolbar>
</field>
<field type="field" name="main_field" weight="-1" layout="0" margin="0" gap="0">
<field type="field" name="left_field" weight="20%" layout="1" margin="0" gap="0">
<field type="field" name="assets" weight="-1" layout="0" margin="0" gap="0" />
<splitterbar type="splitterbar" name="splitterbar3" />
<field type="field" name="objects" weight="-1" layout="0" margin="0" gap="0" />
</field>
<splitterbar type="splitterbar" name="splitterbar1" />
<field type="field" name="canvas" weight="55%" layout="0" margin="0" gap="0" />
<splitterbar type="splitterbar" name="splitterbar2" />
<field type="field" name="properties" weight="-1" layout="0" margin="0" gap="0" />
</field>
<field type="field" name="statusbar" weight="24" layout="0" margin="3" gap="0">
<label type="label" name="_sb" enabled="true" bgcolor="212,208,200" fgcolor="0,0,0" f_size="9" f_weight="400" f_italic="false" f_underline="false" f_strike_out="false" weight="-1" caption="" format="false" transparent="false" halign="0" valign="0" />
</field>
<nana-creator version="0.22.0">
<form mainclass="true" filename="creator" rel_path="true" work_dir="c:/cppprojects/nana-creator/wdir" type="form" name="creator" enabled="true" caption="Nana Creator" width="800" height="500" bgcolor="93,107,153" fgcolor="0,0,0" decoration="true" taskbar="true" floating="false" no_activate="false" min="true" max="true" sizable="true" layout="1" margin="0" gap="0">
<toolbar type="toolbar" name="_tb" enabled="true" bgcolor="204,213,240" fgcolor="0,0,0" f_size="9" f_weight="400" f_italic="false" f_underline="false" f_strike_out="false" weight="30" buttons="(Collection)" scale="21">
<item type="button" key="n1" owner="" text="New project" image="C:\cppprojects\nana-creator\wdir\icons\new_prj.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n2" owner="" text="Load project" image="C:\cppprojects\nana-creator\wdir\icons\load_prj.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n3" owner="" text="Save project" image="C:\cppprojects\nana-creator\wdir\icons\save.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n4" owner="" text="Save project as..." image="C:\cppprojects\nana-creator\wdir\icons\save_as.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n5" owner="" text="-----" image="" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="true" goright="false" />
<item type="button" key="n6" owner="" text="Generate code" image="C:\cppprojects\nana-creator\wdir\icons\output.png" enable="true" textout="true" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n7" owner="" text="-----" image="" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="true" goright="false" />
<item type="button" key="n8" owner="" text="Delete current selection" image="C:\cppprojects\nana-creator\wdir\icons\delete.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n9" owner="" text="-----" image="" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="true" goright="false" />
<item type="button" key="n10" owner="" text="Move up current selection" image="C:\cppprojects\nana-creator\wdir\icons\up.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n11" owner="" text="Move down current selection" image="C:\cppprojects\nana-creator\wdir\icons\down.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n12" owner="" text="-----" image="" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="true" goright="false" />
<item type="button" key="n13" owner="" text="Cut current selection" image="C:\cppprojects\nana-creator\wdir\icons\cut.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n14" owner="" text="Copy current selection" image="C:\cppprojects\nana-creator\wdir\icons\copy.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n15" owner="" text="Paste into/after current selection" image="C:\cppprojects\nana-creator\wdir\icons\paste.png" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
<item type="button" key="n16" owner="" text="&gt;&gt;&gt; Go right &gt;&gt;&gt;" image="" enable="true" textout="false" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="true" />
<item type="button" key="n19" owner="" text="Info..." image="C:\cppprojects\nana-creator\wdir\icons\info.png" enable="true" textout="true" toggle_type="false" toggle_pushed="false" toggle_group="" separator="false" goright="false" />
</toolbar>
<panel type="panel" name="_adi_panel_margin" enabled="true" bgcolor="[inherited],212,208,200" fgcolor="0,0,0" transparent="false" layout="0" weight="-1" margin="5" gap="2">
<panel type="panel" name="_adi_panel" enabled="true" bgcolor="[inherited],212,208,200" fgcolor="0,0,0" transparent="false" layout="0" weight="-1" margin="5" gap="2" />
</panel>
<panel type="panel" name="_sb_panel" enabled="true" bgcolor="64,86,141" fgcolor="0,0,0" transparent="false" layout="0" weight="24" margin="3" gap="2">
<label type="label" name="_sb" enabled="true" bgcolor="[inherited],212,208,200" fgcolor="255,255,255" f_size="9" f_weight="400" f_italic="false" f_underline="false" f_strike_out="false" weight="-1" caption="" format="false" transparent="false" halign="0" valign="0" />
</panel>
</form>
</nana-creator>
3 changes: 3 additions & 0 deletions src/ctrls/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ namespace ctrls
void field::update()
{
//ctrl::update();
auto pw = nana::API::get_widget(nanawdg->parent());
fld.bgcolor(pw->bgcolor());
fld.fgcolor(pw->fgcolor());

// update boxmodel
if(_grid)
Expand Down
3 changes: 2 additions & 1 deletion src/ctrls/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ namespace ctrls
collection_collapse,
string_weight,
check_style,
include_style
include_style,
focus_behavior
};


Expand Down
Loading

0 comments on commit ccc2e39

Please sign in to comment.