| Version 10 (modified by bowtie, 22 months ago) (diff) |
|---|
Padre::Plugin::Cookbook Recipe-04 Draft
This page complements Padre::Plugin::Cookbook Recipe-04, It is just meant to be an aid, with a suggested layout and some ideas to speed you along, enjoy.
- Recipe-04 is all about ListCtrl or ConfigDB now available via Padre::Plugin::CookBook see trunk
- You may find this helpful, see: Download Padre from Repository
Tree Layout
This has been covered in previous Recipes, here for continuity.
Padre-Plugin-Cookbook/
├── fbp
│ └── Recipe04
│ ├── AboutFB.fbp
│ ├── FrameFB.fbp (wx-frame unstable)
│ └── MainFB.fbp
├── lib
│ └── Padre
│ └── Plugin
│ ├── Cookbook
│ │ └── Recipe04
│ │ ├── About.pm
│ │ ├── FBP
│ │ │ ├── AboutFB.pm
│ │ │ └── MainFB.pm
│ │ └── Main.pm
│ └── Cookbook.pm
├── Changes
├── Makefile.PL
├── MANIFEST
├── t
│ ├── 00.load.t
│ ├── 01-Cookbook.t
│ ├── 05-About04.t
│ └── 05-Recipe04.t
└── xt
├── changes.t
├── critic.t
├── hasversion.t
├── meta.t
├── minimumversion.t
├── podcoverage.t
├── podspell.t
└── pod.t
NB Remember Padre can do some of this for you, see: Project Skeleton Generation
wxFormBuilder (xml)
- Use wxFormBuilder, v3.1.70
- Multiple! Why, well it's either a Wx thing or P-P-FormBuilder limitation, this is pants! Glade allows multi-dialogue's in single file.
- This is in progress of being updated, so will be covered in a future Recipe-nn
- The naming convention chosen starts to make more sense when you think about multiple dialogue's.
- There is no pretty table to explain what's going on, you have to use wxFormBuilder, I suggest that you also view the *FB.fbp & *FB.pm files as well.
Create MainFb.fbp
| wxWidget | Properties | Events | |||||
|---|---|---|---|---|---|---|---|
| Icon | Type | name | label/title | public | other | type | value |
Project | Cookbook | n/a | n/a | n/a | n/a | n/a | |
Dialog | Padre::Plugin::Cookbook::Recipe04::FBP::MainFB | Main | n/a | wxRESIZE_BORDER | n/a | n/a | |
wxListCtrl | list_ctrl | n/a | Yes | wxLC_EDIT_LABELS, wxLC_REPORT | _on_list_item_activated, _on_list_col_clicked | n/a | |
Create AboutFb.fbp
| wxWidget | Properties | Events | |||||
|---|---|---|---|---|---|---|---|
| Icon | Type | name | label/title | public | other | type | value |
Project | Cookbook | n/a | n/a | n/a | n/a | n/a | |
Dialog | Padre::Plugin::Cookbook::Recipe04::FBP::AboutFB | About | n/a | wxRESIZE_BORDER | n/a | n/a | |
Padre::Plugin::FormBuilder
- Padre::Plugin::FormBuilder dose not support Wx menus yet, hence fudge work around in Main.
- Use generator to create MainFB.pm from MainFB.fbp
- Use generator to create AboutFB.pm from AboutFB.fbp
- Tip have Padre::Plugin::Cookbook::Recipe04::Main.pm Open before running generator.
- Padre::Plugin::FormBuilder use FBP::Perl ();
- You need to read Source FBP::Perl for which Wx features are supported, it's the only reference :(
Plug-in Code
- Read POD for Padre::Plugin
- Read POD for Cookbook.pm, Main.pm and About.pm.
ListCtrl
- todo
Padre::DB
All DB access is via Padre::DB, you will also need to look at ORLite for supported features. Other wise it's just SQL via Padre DBC.
- Read POD for Padre::DB
- Read POD for ORLite
NB ConfigDB is just an SQLite DB.
StatusBar
We have assumed Show low-priority info messages on statusbar (not in a popup) is true,
if not I suggest you set this in Tools->Preferences->Apperance
sub clean_session { my $self = shift; my $main = $self->main; $main->info('Cleaning Session relation'); .... }
ProgressBar
- Read POD for Padre::Wx::Progress
Run
- perl dev -a -die
- You should now have Cookbook in your Tools menu, enjoy.
Foot Notes
Testing
These may help get you thinking in the write direction.
Padre can help you with this, see: Automated Build and Test
Exrta Tests
- I have recently been exposed to Test::XT, really cool.
- Here is the reasoning Journal article Ouch.
Alias++
Plugin attribute config
Plugins DO have the ability to store stuff in the attribute config
$plugin->config_read $plugin->config_write
Alias++
__END__
Attachments
-
Recipe04.zip
(13.3 KB) -
added by bowtie 2 years ago.
Padre-Plugin-Progdocs
-
wxdialog.png
(811 bytes) -
added by bowtie 23 months ago.
Wx::Dialog.png
-
wxproject.png
(842 bytes) -
added by bowtie 23 months ago.
Wx::Project.png
-
wxListCtrl.png
(2.7 KB) -
added by bowtie 22 months ago.
wxListCtrl



