Thanks Aldo!
> So here's my wish list: =)
> [ Some of them already exist ]
hi Fred,
I've commented your list giving the (probable) Win32::GUI
equivalents to the widgets you mention. if you, or somebody else, has
some comments, feel free to share :-)
The GUI Loft should support those widget then!
The version I downloaded had a very small list of widget. =|
If I could drag'n'drop any of them that would be really really cool! =)
> Standard:
> =========
> TMainMenu: Main Menu (top window menu)
Win32::GUI::Menu
> TPopupMenu: Pop up Menu (right-click menu)
Win32::GUI::Menu (sub-menus can be used with the TrackPopupMenu function)
> TLabel: Label
Win32::GUI::Label
> TEdit: Textbox
Win32::GUI::Textfield
> TPassword: Textbox for password
Win32::GUI::Textfield (with -password => 1)
> TMemo: MultiLine TextBox area
Win32::GUI::Textfield (with -multiline => 1)
> TButton: Button
Win32::GUI::Button
> TCheckBox: Check Box
Win32::GUI::Checkbox
> TRadioButton: Radio button (element of a group)
Win32::GUI::RadioButton
> TListBox: List box
Win32::GUI::Listbox
> TComboBox: Combo box
Win32::GUI::Combobox
> TScrollBar: Scroll bar vertical or horizontal
missing, but do we need one?
yes. There should be a way to get such, it's a win32 gui element.
Could be needed for composed widget.
> TRadioGroup: Panel Box container for radio buttons set
missing, and we need one :-)
Not necessarly, but how do you group radio set ?
Inside a hash? I know VB5 doesn't require such, but Borland does.
+--- Fruits -------+
| o Ananas |
| o Bananas |
| o Cherry |
+------------------+
+--- Names --------+
| o Fred |
| o Garry |
| o Larry |
+------------------+
There should be a way to get such, it's a also win32 gui element.
> Additional: { Custom widget adjacement }
> ===========
> TBitBtn: Image with a bitmap on it left hand side with text
don't know what it is.
This is SO FUNDAMENTAL for usability reasons:
+------------------------+
| [folder] Open |
+------------------------+
+------------------------+
| [disk] Save |
+------------------------+
+------------------------+
| [door] Exit |
+------------------------+
> TMaskEdit: TEdit with RegExp input validation mask
should be easy with a few lines of code?
Sure, but why not making it inside a perl class with inheritance.
For instance, the hook up needed such that it takes only numerics
/^[0-9]{0,6}$/
Such that the textbox doesn't do anything on non-numerics: "characters being
ignored".
> TStringGrid: Excel like Grid widget for text only
> TDrawGrid: Excel like Grid widget for text or image
see Win32::GUI::Grid by Laurent Rocher
> TImage: Image container
Win32::GUI::Label (with -bitmap => $Bitmap)
> TShape: Shape object: Rectangle, oval, square, circle,
rounded
> box
Win32::GUI::Graphic (or InteractiveGraphic) (mostly)
> TBevel: 3D Line seperator for visual grouping
Win32::GUI::Groupbox (maybe?)
> TScrollBox: ListBox with horizontal scrolling
Win32::GUI::Listbox
> TCheckListBox: ListBox with check marks
Win32::GUI::ListView (with -checkboxes => 1)
> Win32: {COMCTL32.DLL version 4.70 or later}
> ======
> TTabControl: Tab page
> TPageControl: Tab page controller
actually only Win32::GUI::Tabstrip
> TRichEdit: WordPad like Memo container area with font and
images
Win32::GUI::RichEdit
> TTrackBar: Sound slider
don't know what it is
Something like
_______________________
| . \|/ . . . . . . . . |
|_______________________|
> TProgressBar: Installation like progress bar
Win32::GUI::ProgressBar
> TUpDown: Up/Down button
+----+
| /\ |
+----+
| \/ |
+----+
> THotKey: HotKey tracking visible container
missing.
> TMonthCalendar: Microsoft Calendar
missing.
Isn't a variable pass to Win32::GUI::DateTime
in order to get it?
They should go together.
> TDateTimePicker: Microsoft Calendar inside a combo box
Win32::GUI::DateTime
> TTreeView: Tree view component
Win32::GUI::TreeView
> TListView: List view component
Win32::GUI::ListView
> TStatusBar: Status bar component
Win32::GUI::StatusBar
> TToolBar: MS Office Tool Bar container
Win32::GUI::Toolbar
> TCoolBar: MS Office Tool Bar with scroll container
see Win32::GUI::Rebar
> TPageScroller: MS Office Tool Bar with scroll and moveable
container
Win32::GUI::Rebar
> System:
> =======
> TTimer: Auto-restart count-down Timer event driven
> {SetTimer and KillTimer, and to simplify processing the WM_TIMER
messages}
Win32::GUI::Timer
> TMediaPlayer: Media Player button (play, pause, stop, ff, rew,
prev,
> next, rec, eject)
> {Custom bitmap button with predefined callback}
Win32::GUI::Animation (very limited, tho)
> TOleContainer: Interface to OLE 2.0 object container
> {InsertObjectDialog can be called to embed or link to an OLE 2.0 object}
see Win32::GUI::AxWindow by Laurent Rocher
> Internet: (Internet Explorer SDK documented on MSDN)
> =========
> TCppWebBrowser: Internet Explorer Embedded DCOM Container
see Win32::GUI::AxWindow by Laurent Rocher
Looks great, is there a way to print from it like from C++ Builder?
To call Page Setup, to get special event like webpage download 0-100% stats?
Mainly, I'm interested in having a GUI that can generate and print HTML
reports
using Internet Explorer and feed it to the printer directly, without user
interaction!
> Samples: (bunch of widget hook-up together)
> ========
> TCSpinEdit: TextBox with up/down button embedded
missing.
+----------------------------------------------------+----+
| 11 0000 | /\ |
| 1 0 0 +----+
| 111 0000 | \/ |
+----------------------------------------------------+----+
> Dialogs: (Windows SDK documented on MSDN)
> ========
> TOpenDialog: Windows Open dialog
Win32::GUI::GetOpenFileName
> TSaveDialog: Windows Save dialog
Win32::GUI::GetSaveFileName
> TOpenPictureDialog: Windows Open dialog with picture preview
> TSavePictureDialog: Windows Save dialog with picture preview
missing.
GetOpenFileName/GetSaveFileName with a Window hook-up for picture event,
now how do we do that in Perl ?
> TFontDialog: Windows Font picker dialog
Win32::GUI::ChooseFont
> TColorDialog: Windows Color picker dialog
Win32::GUI::ChooseColor
> TPrintDialog: Windows Print dialog
> TPrintSetupDialog: Windows Print setup dialog
It's inside the Windows SDK.
> TFindDialog: Windows Find dialog
> TReplaceDialog: Windows Replace dialog
Should be available somewhere in the SDK
missing.
> Homemade dialogs: (Windows SDK documented on MSDN)
> =================
> TOpenWebDialog: Windows Open dialog with Internet Explorer preview
> TSaveWebDialog: Windows Save dialog with Internet Explorer preview
missing.
GetOpenFileName/GetSaveFileName with a Window hook-up for web document
event,
now how do we do that in Perl ?
I have code for C++ Builder,
anybody wanna help for XS translation,
since I have no clue how to use XS. =P
The same ideas goes for image viewing, sound playing, etc.
You take a Windows SDK Dialog and take some space below or to the right,
put some widget in there and make an event controller from one to the other.
Resize the dialog such that it fit and make it centered.
// ----------------------------------------------
// In the TWebOpenDialog.hpp file:
// ----------------------------------------------
#ifndef __TWebOpenDialog__HPP__
#define __TWebOpenDialog__HPP__
#include <vcl.h>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Dialogs.hpp>
#include "SHDocVw_OCX.h"
#include <OleCtrls.hpp>
#include <ExtDlgs.hpp>
#pragma package(smart_init)
#pragma link "SHDocVw_OCX"
// #include <Abicast/Tools/TWebOpenDialog.cpp>
class PACKAGE TWebOpenDialog : public TOpenDialog
{
typedef Dialogs::TOpenDialog inherited;
private:
// See constructor initializer list for values:
const int addwidth; // Add at bottom
const int addheight; // Add at right
TPanel* pnl; // Gets button clicks to VCL
RECT staticrect; // Roughly, basic OpenDlg controls
RECT clientrect; // Dialog, after enlargment
HWND parenthandle; // Because the VCL always hooks
// the Windows dialog, Windows creates a parent.
int DialogWidth; // As changed, here
int DialogHeight;
bool onceonly;
protected:
DYNAMIC void __fastcall TWebOpenDialog::DoShow( void );
DYNAMIC void __fastcall TWebOpenDialog::DoSelectionChange(void);
public:
__fastcall TWebOpenDialog( TComponent* Owner );
inline AnsiString __fastcall Browse()
{
AnsiString file = "";
if( this->Execute() )
{
file = this->FileName;
}
return file;
}
inline bool verifyExtension( const AnsiString& url )
{
int pos = url.LastDelimiter( "." );
if ( pos > 0 )
{
AnsiString ext = url.SubString( pos+1, 3 );
ext = ext.LowerCase();
const char* s = ext.c_str();
if ( !strcmp( s, "jpg" ) ||
!strcmp( s, "jpe" ) ||
!strcmp( s, "gif" ) ||
!strcmp( s, "bmp" ) ||
!strcmp( s, "wmf" ) ||
!strcmp( s, "emf" ) ||
!strcmp( s, "pcx" ) ||
!strcmp( s, "png" ) ||
!strcmp( s, "htm" ) ||
!strcmp( s, "php" ) ||
!strcmp( s, "txt" )
) return true;
}
return false;
}
inline void goURL()
{
// TCppWebBrowser
AnsiString url = this->FileName;
if ( verifyExtension( url ) && FileExists( url ) )
{
web->Navigate2( new TVariant( url ) );
}
}
__published:
TCppWebBrowser *web;
};
// ----------------------------------------------
#endif // End of __TWebOpenDialog__HPP__
// ----------------------------------------------
// In the TWebOpenDialog.cpp file:
// ----------------------------------------------
#ifndef __TWebOpenDialog__CPP__
#define __TWebOpenDialog__CPP__
// ----------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "dlgs.h"
#include <Abicast/Tools/TWebOpenDialog.hpp>
//---------------------------------------------------------------------------
// Written and tested in BCB3 under Win98 SE.
// Tested also in BCB5 under Win98 SE
//---------------------------------------------------------------------------
// The principal reference sources were
// Boian Mitov's TBMMediaDialog, at
// http://www.mitov.com/
// Yoto Yotov, for example
// http://thunder.prohosting.com/~cbdn/cd002.htm
//---------------------------------------------------------------------------
// API Solution with VCL:
// http://groups.google.com/groups?selm=3b334ba9%242_1%40dnews
// (long link-repaste if word-wrapped)
//---------------------------------------------------------------------------
// Microsoft's list of ControlID's for OpenFile is titled
// "Explorer-Style Control Identifiers"
// (in case it moves) but it's now at:
//
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/commdlg_7yib.asp
// (long link-repaste if word-wrapped)
//---------------------------------------------------------------------------
// Constructor. Note that the Windows Handle of the Dialog
// box, and the individual dialog controls are NOT
// available at this time.
//---------------------------------------------------------------------------
__fastcall TWebOpenDialog::TWebOpenDialog( TComponent* Owner )
: TOpenDialog( Owner ),
addwidth( 300 ), // Pixels to right
addheight( 0 ), // Pixels to bottom
onceonly( false ),
parenthandle( NULL )
{
Title = "Open Picture Dialog";
pnl = new TPanel( this );
web = new TCppWebBrowser( this );
Filter = "Web Images "
"(*.jpg;*.gif;*.bmp;*.jpeg;*.jpe;*.png)|"
"*.jpg;*.gif;*.bmp;*.jpeg;*.jpe;*.png|"
"All Images "
"(*.jpg;*.gif;*.bmp;*.emf;*.wmf;*.pcx;*.jpeg;*.jpe;*.png)|"
"*.jpg;*.gif;*.bmp;*.emf;*.wmf;*.pcx;*.jpeg;*.jpe;*.png|"
"JPEG Image Files (*.jpg;*.jpeg;*.jpe)|"
"*.jpg;*.jpeg;*.jpe)|"
"GIF Image Files (*.gif)|*.gif|"
"PCX Image Files (*.pcx)|*.pcx|"
"PNG Image Files (*.png)|*.png|"
"Bitmap Images (*.bmp)|*.bmp|"
"Enhanced Metafiles (*.emf)|*.emf|"
"Windows Metafiles (*.wmf)|*.wmf|"
"All Files (*.*)|*.*";
}
//---------------------------------------------------------------------------
void __fastcall TWebOpenDialog::DoShow(void)
{
long newtop; // After enlargement, to center
long newleft;
RECT rect; // The old dialog, before enlargement
if( !onceonly )
{
onceonly = true;
parenthandle = GetParent( Handle ); // Frequently used
// staticrectTRect=GetStaticRect();
// Line above fails, for at least two reasons:
// (1)The VCL uses the VCL Handle (FHandle) instead of
// GetParent(FHandle). (2)The ControlID for the
// static rectangle, stc32, does not exist, probably
// because the Open Dialog has no *custom* template.
// Instead, we will approximate the static rectangle
// with the client size of the unmodified OpenDialog,
// several pixels too big. This will leave a few pixels
// between the static controls and the top of our TPanel.
// Client coordinates
GetClientRect( parenthandle, &staticrect );
// Get current size of entire dialog, resize, and center
// Screen coordinates
GetWindowRect( parenthandle, &rect );
// Add new space below and to the right of the static
// rectangle. If you must add controls ABOVE the static
// rectangle, you have to use the API "Template" method.
DialogWidth = rect.right - rect.left + addwidth;
DialogHeight = rect.bottom - rect.top + addheight;
newleft = ( Screen->Width - DialogWidth ) / 2; // Centering
newtop = ( Screen->Height - DialogHeight ) / 2;
// Increase size of, and center the dialog window
MoveWindow( parenthandle, newleft, newtop,
DialogWidth, DialogHeight, true );
// Get dimensions for sizing the TPanel
GetClientRect( parenthandle, &clientrect );
// Finish specifying the added controls, now that
// the dialog window exists. Note that the TEdit will
// function as expected, even if it is not placed on a
// TPanel. However, the Button's clicks will NOT reach
// their Event unless the TButton is placed on the TPanel.
pnl->ParentWindow = parenthandle;
// SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
pnl->SetBounds(
rect.right - rect.left - 7,
0,
addwidth,
DialogHeight
);
// Next two lines to make the TPanel imperceptible.
pnl->BevelInner = bvNone;
pnl->BevelOuter = bvNone;
// TPanel
web->ParentWindow = pnl->Handle;
web->Width = addwidth - 19;
web->Height = DialogHeight - 28 - 10;
web->Top = 4;
web->Left = 0;
goURL();
// The following line answers an F.A.Q.
// It's not needed to *add* controls to the OpenDialog.
// Note that IDOK is in the #include-d dlgs.h
SendMessage(
parenthandle, CDM_SETCONTROLTEXT, IDOK,
(long)"&Open File"
);
} // onceonly bracket
inherited::DoShow(); // Allow user's OnShow
Abort(); // Cancel Windows' WM_NOTIFY message to dialog
}
//---------------------------------------------------------------------------
// Example of TEdit used for output display:
// This override fills in the added edit with
// additional information about the selected file.
//---------------------------------------------------------------------------
void __fastcall TWebOpenDialog::DoSelectionChange(void)
{
// Use Inherited property
goURL();
inherited::DoSelectionChange(); // End user's Event
}
//---------------------------------------------------------------------------
#pragma package(smart_init)
#endif // End of __TWebOpenDialog__CPP__
cheers,
Aldo
Sincerely yours,
Fred.
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963