wiki:PadrePluginCookbookRecipie04

Version 4 (modified by bowtie, 3 years ago) (diff)

--

ListCtrl or ConfigDB RC1

Padre::Plugin::Cookbook Recipe-04 Draft

  • Recipe-04 is all about ListCtrl or ConfigDB now available via Padre::Plugin::CookBook see trunk
  • Every Plug-in needs an About dialogue or Multiple Dialogues.
  • This page complements Padre::Plugin::Cookbook Recipe-04, just an aid, with a suggested layout, enjoy. More detail will follow in subsequent Cookbooks.
  • You can obtain this via svn Padre::Plugin::Cookbook into your working copy of Padre trunk.

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 FormBuilder limitation, this is pants! Glade allows multi-dialogue's in single file.
  • 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

wxWidgetPropertiesEvents
IconTypenamelabel/titlepublicothertypevalue

Wx::Project.png

Project

Cookbook

n/a

n/a

n/a

n/a

n/a

Wx::Dialog.png

Dialog

Padre::Plugin::Cookbook::Recipe04::FBP::MainFB

Main

n/a

wxRESIZE_BORDER

n/a

n/a

Create AboutFb.fbp

wxWidgetPropertiesEvents
IconTypenamelabel/titlepublicothertypevalue

Wx::Project.png

Project

Cookbook

n/a

n/a

n/a

n/a

n/a

Wx::Dialog.png

Dialog

Padre::Plugin::Cookbook::Recipe04::FBP::AboutFB

Main

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

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.

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


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

Alias++

__END__

Attachments (4)

Download all attachments as: .zip