Added fl (frame layout) to wxWindows, from source tidied by Hans Van Leemputten <Hansvl@softhome.net>.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-07-24 15:27:12 +00:00
parent 3c85ada9db
commit 8e08b761b0
109 changed files with 21049 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
# $Id$
CONTRIB_SAMPLES=mmedia ogl stc gizmos canvas xrc plot applet
CONTRIB_SAMPLES=mmedia ogl stc gizmos canvas xrc plot applet fl
all:
@for d in $(CONTRIB_SAMPLES); do (cd $$d && $(MAKE)); done

View File

@@ -0,0 +1,10 @@
# $Id$
CONTRIB_SAMPLES=fl_demo1 fl_demo2 fl_sample1 fl_sample2 fl_sample3
all:
@for d in $(CONTRIB_SAMPLES); do (cd $$d && $(MAKE)); done
clean:
@for d in $(CONTRIB_SAMPLES); do (cd $$d && $(MAKE) clean); done

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,25 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# "%W% %G%"
#
# Makefile : Builds sample on UNIX/Linux.
top_srcdir = @top_srcdir@/..
top_builddir = ../../../..
TARGET = fl_demo1
program_dir = contrib/samples/fl/$(TARGET)
APPEXTRADEFS = -I$(top_srcdir)/contrib/include -DBMP_DIR=\"../bitmaps/\"
APPEXTRALIBS = $(top_builddir)/lib/libfl.@WX_TARGET_LIBRARY_TYPE@
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).o
include $(top_builddir)/src/makeprog.env

View File

@@ -0,0 +1,108 @@
# Microsoft Developer Studio Project File - Name="fl_demo1" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=fl_demo1 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak" CFG="fl_demo1 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "fl_demo1 - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "fl_demo1 - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "fl_demo1 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../../include" /I "../../../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib fl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"../../lib" /libpath:"../../contrib/lib"
!ELSEIF "$(CFG)" == "fl_demo1 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../../../contrib/include" /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib fld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib"
!ENDIF
# Begin Target
# Name "fl_demo1 - Win32 Release"
# Name "fl_demo1 - Win32 Debug"
# Begin Source File
SOURCE=.\fl_demo1.cpp
!IF "$(CFG)" == "fl_demo1 - Win32 Release"
!ELSEIF "$(CFG)" == "fl_demo1 - Win32 Debug"
# ADD CPP /Yc"wx/wxprec.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\fl_demo1.rc
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "fl_demo1"=.\fl_demo.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,241 @@
/////////////////////////////////////////////////////////////////////////////
// Name: No names yet.
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by: Sebastian Haase (June 21, 2001)
// Created: 04/11/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "fl_demo1.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/textctrl.h"
// fl headers
#include "wx/fl/controlbar.h" // core API
// extra plugins
#include "wx/fl/barhintspl.h" // beveal for bars with "X"s and grooves
#include "wx/fl/rowdragpl.h" // NC-look with dragable rows
#include "wx/fl/cbcustom.h" // customization plugin
#include "wx/fl/hintanimpl.h"
// beuty-care
#include "wx/fl/gcupdatesmgr.h" // smooth d&d
#include "wx/fl/antiflickpl.h" // double-buffered repaint of decorations
#include "wx/fl/dyntbar.h" // auto-layouting toolbar
#include "wx/fl/dyntbarhnd.h" // control-bar dimension handler for it
#include "fl_demo1.h"
// comment it out if it breaks, (this is my workaround for MSDev 4.0 linker)
char wxDummyChar;
IMPLEMENT_APP (MyApp)
bool MyApp::OnInit(void)
{
MyFrame *frame = new MyFrame(NULL);
frame->SetBackgroundColour( wxColour(192,192,192) );
wxMenu *file_menu = new wxMenu;
file_menu->Append( NEW_TEST_LOAD, "&Load layouts" );
file_menu->Append( NEW_TEST_SAVE, "&Store layouts" );
file_menu->Append( NEW_TEST_EXIT, "E&xit" );
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, "&File");
frame->SetMenuBar(menu_bar);
frame->CreateStatusBar(3);
frame->Show(TRUE);
frame->mpClientWnd->Refresh();
SetTopWindow(frame);
wxMessageBox("Hello, this demo has a bunch of yet-not-fixed-bugs and misssing functionality\n" \
"The ONLY purpose is to demostrate self-layouting toolbars,\nflat-bitmapped-buttons and 2-new FL-plugins" \
"(cbRowDragPlugin & cbBarHintsPlugin)\n\n" \
"BTW, disabled images and label-text are rendered at run-time" );
return TRUE;
}
/***** Implementation for class MyFrame *****/
BEGIN_EVENT_TABLE( MyFrame, wxFrame )
// EVT_CHAR_HOOK(MyFrame::OnKeyDown)
// EVT_PAINT( MyFrame::OnPaint )
EVT_MENU( NEW_TEST_SAVE, MyFrame::OnSave )
EVT_MENU( NEW_TEST_LOAD, MyFrame::OnLoad )
EVT_MENU( NEW_TEST_EXIT, MyFrame::OnExit )
END_EVENT_TABLE()
void MyFrame::OnLoad( wxCommandEvent& event )
{
wxMessageBox("Hey - you found a BIG question-mark !!");
}
void MyFrame::OnSave( wxCommandEvent& event )
{
wxMessageBox("Hey - you found another BIG question-mark !!");
}
void MyFrame::OnExit( wxCommandEvent& event )
{
Destroy();
}
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
{
wxTextCtrl* pCtrl =
new wxTextCtrl( this, -1, value,
wxDefaultPosition, wxSize(0,0), wxTE_MULTILINE );
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
return pCtrl;
}
MyFrame::MyFrame(wxFrame *frame)
: wxFrame( frame, -1, "wxWindows 2.0 wxFrameLayout Test Application", wxDefaultPosition,
wxSize( 700, 500 ),
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
"freimas" )
{
mpClientWnd = CreateTextCtrl( "Client window" );
mpLayout = new wxFrameLayout( this, mpClientWnd );
#ifdef __WXGTK__
cbCommonPaneProperties props;
mpLayout->GetPaneProperties( props );
props.mRealTimeUpdatesOn = FALSE; // real-time OFF!!!
mpLayout->SetPaneProperties( props, wxALL_PANES );
#endif
mpLayout->SetUpdatesManager( new cbGCUpdatesMgr() );
// this is now default...
//mpLayout->SetMargins( 1,1,1,1 ); // gaps for vertical/horizontal/right/left panes
// setup plugins for testing
mpLayout->PushDefaultPlugins();
mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // facny "X"es and beveal for bars
mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbRowDragPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbAntiflickerPlugin ) );
mpLayout->AddPlugin( CLASSINFO( cbSimpleCustomizationPlugin ) );
// drop in some bars
cbDimInfo sizes0( 200,45, // when docked horizontally
200,85, // when docked vertically
175,35, // when floated
FALSE, // the bar is not fixed-size
4, // vertical gap (bar border)
4 // horizontal gap (bar border)
);
cbDimInfo sizes1( 150,35, // when docked horizontally
150,85, // when docked vertically
175,35, // when floated
TRUE, // the bar is not fixed-size
4, // vertical gap (bar border)
4 // horizontal gap (bar border)
);
cbDimInfo sizes2( 175,45, // when docked horizontally
175,37, // when docked vertically
170,35, // when floated
TRUE, // the bar is not fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
mpLayout->AddBar( CreateTextCtrl("Hello"), // bar window
sizes0, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
"InfoViewer1", // name to refere in customization pop-ups
TRUE
);
mpLayout->AddBar( CreateTextCtrl("Bye"), // bar window
sizes0, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
1, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
"InfoViewer2", // name to refere in customization pop-ups
TRUE
);
mpLayout->AddBar( CreateTextCtrl("Fixed0"), // bar window
sizes1, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
"ToolBar1", // name to refere in customization pop-ups
TRUE
);
wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
pToolBar->Create( this, -1 );
// 1001-1006 ids of command events fired by added tool-buttons
pToolBar->AddTool( 1001, BMP_DIR "new.bmp" );
pToolBar->AddTool( 1002, BMP_DIR "open.bmp" );
pToolBar->AddTool( 1003, BMP_DIR "save.bmp" );
pToolBar->AddTool( 1004, BMP_DIR "cut.bmp" );
pToolBar->AddTool( 1005, BMP_DIR "copy.bmp" );
pToolBar->AddTool( 1006, BMP_DIR "paste.bmp" );
mpLayout->AddBar( pToolBar, // bar window (can be NULL)
sizes2, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
"ToolBar2", // name to refere in customization pop-ups
FALSE
);
mpLayout->EnableFloating( TRUE ); // off, thinking bout wxGtk...
}
MyFrame::~MyFrame()
{
if ( mpLayout)
delete mpLayout; // should be destroyed manually
}

View File

@@ -0,0 +1,55 @@
/////////////////////////////////////////////////////////////////////////////
// Name: No names yet.
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by: Sebastian Haase (June 21, 2001)
// Created: 04/11/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __NEW_TEST_G__
#define __NEW_TEST_G__
#ifdef __GNUG__
#pragma interface "fl_demo1.h"
#endif
#define NEW_TEST_SAVE 1101
#define NEW_TEST_LOAD 1102
#define NEW_TEST_EXIT 1103
#include "wx/panel.h"
// Define a new application type
class MyApp: public wxApp
{
public:
bool OnInit(void);
};
// Define a new frame type
class MyFrame: public wxFrame
{
public:
wxFrameLayout* mpLayout;
wxTextCtrl* mpClientWnd;
wxTextCtrl* CreateTextCtrl( const wxString& value );
public:
MyFrame(wxFrame *frame);
virtual ~MyFrame();
bool OnClose(void) { Show(FALSE); return TRUE; }
void OnLoad( wxCommandEvent& event );
void OnSave( wxCommandEvent& event );
void OnExit( wxCommandEvent& event );
DECLARE_EVENT_TABLE()
};
#endif

View File

@@ -0,0 +1,3 @@
/* mondrian ICON "mondrian.ico" */
#include "wx/msw/wx.rc"

View File

@@ -0,0 +1,23 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds sample for 32-bit BC++
WXDIR = ..\..\..\..
TARGET = fl_demo1
EXTRACPPFLAGS =-DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WSLIBDIR)\fl.lib
!else
EXTRALIBS = $(WSLIBDIR)\fld.lib
!endif
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32

View File

@@ -0,0 +1,18 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile for wxWorkshop for mingw & cygwin.
WXDIR = ../../../..
TARGET = fl_demo1
EXTRACPPFLAGS = -DBMP_DIR=\"../bitmaps/\"
EXTRALIBS = $(WXDIR)/lib/libfl.a
OBJECTS = $(TARGET).o
include $(WXDIR)/src/makeprog.g95

View File

@@ -0,0 +1,24 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds fl sample (VC++, WIN32)
# Use FINAL=1 argument to nmake to build final version with no debug info.
WXDIR = ..\..\..\..
TARGET = fl_demo1
EXTRAINC = -DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WXDIR)\lib\fl.lib
!else
EXTRALIBS = $(WXDIR)\lib\fld.lib
!endif
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.vc

View File

@@ -0,0 +1,25 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# "%W% %G%"
#
# Makefile : Builds sample on UNIX/Linux.
top_srcdir = @top_srcdir@/..
top_builddir = ../../../..
TARGET = fl_demo2
program_dir = contrib/samples/fl/$(TARGET)
APPEXTRADEFS = -I$(top_srcdir)/contrib/include -DBMP_DIR=\"../bitmaps/\"
APPEXTRALIBS = $(top_builddir)/lib/libfl.@WX_TARGET_LIBRARY_TYPE@
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).o
include $(top_builddir)/src/makeprog.env

View File

@@ -0,0 +1,108 @@
# Microsoft Developer Studio Project File - Name="fl_demo2" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=fl_demo2 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak" CFG="fl_demo2 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "fl_demo2 - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "fl_demo2 - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "fl_demo2 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../../include" /I "../../../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib fl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"../../lib" /libpath:"../../contrib/lib"
!ELSEIF "$(CFG)" == "fl_demo2 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../../../contrib/include" /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib fld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib"
!ENDIF
# Begin Target
# Name "fl_demo2 - Win32 Release"
# Name "fl_demo2 - Win32 Debug"
# Begin Source File
SOURCE=.\fl_demo2.cpp
!IF "$(CFG)" == "fl_demo2 - Win32 Release"
!ELSEIF "$(CFG)" == "fl_demo2 - Win32 Debug"
# ADD CPP /Yc"wx/wxprec.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\fl_demo2.rc
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "fl_demo2"=.\fl_demo.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,986 @@
/////////////////////////////////////////////////////////////////////////////
// Name: No names yet.
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by: Sebastian Haase (June 21, 2001)
// Created: 04/11/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "fl_demo2.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
// wxWindows headers.
#include "wx/treectrl.h"
#include "wx/imaglist.h"
#include "wx/notebook.h"
// fl headers.
#include "wx/fl/controlbar.h"
#include "wx/fl/rowlayoutpl.h"
#include "wx/fl/antiflickpl.h"
#include "wx/fl/bardragpl.h"
#include "wx/fl/cbcustom.h"
#include "wx/fl/rowdragpl.h"
// some extra fl plugins.
#include "wx/fl/barhintspl.h"
#include "wx/fl/hintanimpl.h"
#include "wx/fl/dyntbar.h"
#include "wx/fl/dyntbarhnd.h" // fl-dimension-handler for dynamic toolbar
#include "fl_demo2.h"
/***** Implementation for class MyApp *****/
// Create a new application object
IMPLEMENT_APP (MyApp)
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit(void)
{
// Create the main frame window
MyFrame *frame = new MyFrame(NULL, "wxWindows 2.0 wxFrameLayout demo", 50, 50, 650, 540);
// Give it an icon
#ifdef __WINDOWS__
frame->SetIcon(wxIcon("mondrian"));
#endif
#ifdef __X__
frame->SetIcon(wxIcon("aiai.xbm"));
#endif
// Make a menubar
wxMenu *file_menu = new wxMenu;
wxMenu *active_menu = new wxMenu;
file_menu->Append( ID_LOAD, "&Load layouts" );
file_menu->Append( ID_STORE, "&Store layouts" );
file_menu->AppendSeparator();
file_menu->Append( ID_AUTOSAVE, "&Auto Save Layouts", "save layouts on exit", TRUE );
file_menu->AppendSeparator();
file_menu->Append(MINIMAL_ABOUT, "A&bout !");
file_menu->Append(MINIMAL_QUIT, "E&xit\tTab");
//active_menu->Append( ID_SETTINGS, "&Settings...\tCtrl" );
//active_menu->AppendSeparator();
active_menu->Append( ID_REMOVE, "&Remove Active" );
active_menu->Append( ID_REMOVEALL, "Remove &All" );
active_menu->Append( ID_RECREATE, "Re&create" );
active_menu->AppendSeparator();
active_menu->Append( ID_FIRST, "Activate f&irst layout \tF1", "activate it", TRUE );
active_menu->Append( ID_SECOND, "Activate &second layout\tF2","activate it", TRUE );
active_menu->Append( ID_THIRD, "Activate &third layout\tF3","activate it", TRUE );
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, "&File");
menu_bar->Append(active_menu, "Active &Layout");
frame->CreateStatusBar(3);
frame->SetMenuBar(menu_bar);
frame->SyncMenuBarItems();
// Show the frame
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
MyFrame::~MyFrame()
{
// frame-layouts is not a windows (objects), thus should
// be cleaned up manually
for( int i = 0; i != MAX_LAYOUTS; ++i )
{
if ( mLayouts[i] )
delete mLayouts[i];
}
if ( mpNestedLayout )
delete mpNestedLayout;
if ( mpAboutBoxLayout )
delete mpAboutBoxLayout;
}
/***** Implementation for class MyFrame *****/
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU( MINIMAL_QUIT, MyFrame::OnQuit )
EVT_MENU( MINIMAL_ABOUT, MyFrame::OnAbout )
EVT_MENU( ID_LOAD, MyFrame::OnLoad )
EVT_MENU( ID_STORE, MyFrame::OnStore )
EVT_MENU( ID_AUTOSAVE, MyFrame::OnAutoSave )
//EVT_MENU( ID_SETTINGS, MyFrame::OnSettings )
EVT_MENU( ID_REMOVE, MyFrame::OnRemove )
EVT_MENU( ID_REMOVEALL, MyFrame::OnRemoveAll )
EVT_MENU( ID_RECREATE, MyFrame::OnRecreate )
EVT_MENU( ID_FIRST, MyFrame::OnFirst )
EVT_MENU( ID_SECOND, MyFrame::OnSecond )
EVT_MENU( ID_THIRD, MyFrame::OnThird )
EVT_BUTTON( ID_SAY_ITSOK, MyFrame::OnSayItsOk )
EVT_BUTTON( ID_BTN_YES, MyFrame::OnBtnYes )
EVT_BUTTON( ID_BTN_NO, MyFrame::OnBtnNo )
EVT_BUTTON( ID_BTN_ESC, MyFrame::OnBtnEsc )
EVT_CHAR_HOOK( MyFrame::OnChar )
END_EVENT_TABLE()
// My frame constructor
MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h)
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)),
mpNestedLayout( NULL ),
mpAboutBoxLayout( NULL ),
mActiveLayoutNo( FIRST_LAYOUT ),
mAutoSave( TRUE ),
mSavedAlready( FALSE ),
mpClntWindow( NULL ),
mImageList( 16,16, FALSE, 2 )
{
mpInternalFrm = (wxPanel*)this;
mAboutBox.Create( this, -1, "About box in wxWindows style...",
wxDefaultPosition,
wxSize( 385,220),
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );
int i = 0;
for( i = 0; i != MAX_LAYOUTS; ++i )
mLayouts[i] = NULL;
// image-list is one of the few objects which
// currently cannot be serialized, create it first
// and use it as initial reference (IR)
wxBitmap bmp1,bmp2;
if ( wxFileExists( BMP_DIR "folder_icon.bmp" ) )
bmp1.LoadFile( BMP_DIR "folder_icon.bmp", wxBITMAP_TYPE_BMP );
if ( wxFileExists( BMP_DIR "class_icon1.bmp" ) )
bmp2.LoadFile( BMP_DIR "class_icon1.bmp", wxBITMAP_TYPE_BMP );
mImageList.Add( bmp1 );
mImageList.Add( bmp2 );
InitAboutBox();
// create multiple layouts
mpNestedLayout = 0;
mpClntWindow = CreateTxtCtrl("client window");
// Create all layouts
for( i = 0; i != MAX_LAYOUTS; ++i )
{
CreateLayout( i );
}
// hide others
for( i = SECOND_LAYOUT; i != MAX_LAYOUTS; ++i )
{
mLayouts[i]->HideBarWindows();
}
// activate first one
mLayouts[FIRST_LAYOUT]->Activate();
mActiveLayoutNo = FIRST_LAYOUT;
}
/*** event handlers ***/
bool MyFrame::OnClose(void)
{
// USEFUL TRICK:: avoids flickering of application's frame
// when closing NN windows on exit:
this->Show(FALSE);
if ( (mAutoSave && mSavedAlready) || !mAutoSave )
{
}
else
{
wxCommandEvent evt;
this->OnStore(evt);
}
mAboutBox.Destroy();
this->Destroy();
return TRUE;
}
void MyFrame::OnLoad( wxCommandEvent& event )
{
wxMessageBox("Hey - you found a BIG question-mark !!");
}
void MyFrame::OnStore( wxCommandEvent& event )
{
wxMessageBox("Hey - you found another BIG question-mark !!");
}
void MyFrame::OnAutoSave( wxCommandEvent& event )
{
mAutoSave = !mAutoSave;
wxCommandEvent evt;
this->OnStore(evt);
SyncMenuBarItems();
}
void MyFrame::OnRemove( wxCommandEvent& event )
{
RemoveLayout( mActiveLayoutNo );
Refresh();
}
void MyFrame::OnRemoveAll( wxCommandEvent& event )
{
for( int i = 0; i != MAX_LAYOUTS; ++i )
{
RemoveLayout( i );
}
Refresh();
}
void MyFrame::OnRecreate( wxCommandEvent& event )
{
OnRemove( event ); // first destroy active layout
CreateLayout( mActiveLayoutNo );
mLayouts[mActiveLayoutNo]->Activate();
}
void MyFrame::OnFirst( wxCommandEvent& event )
{
ActivateLayout( FIRST_LAYOUT );
}
void MyFrame::OnSecond( wxCommandEvent& event )
{
ActivateLayout( SECOND_LAYOUT );
}
void MyFrame::OnThird( wxCommandEvent& event )
{
ActivateLayout( THIRD_LAYOUT );
}
void MyFrame::OnQuit( wxCommandEvent& event )
{
// USEFUL TRICK:: avoids flickering of application's frame
// when closing NN windows on exit:
this->Show(FALSE);
if ( (mAutoSave && mSavedAlready) || !mAutoSave )
{
}
else
{
wxCommandEvent evt;
this->OnStore(evt);
}
Destroy();
}
void MyFrame::OnAbout( wxCommandEvent& event )
{
wxFont font;
#ifdef __WXMSW__
font.SetFaceName("MS Sans Serif");
#else
font.SetFamily( wxSWISS );
#endif
font.SetStyle( wxSLANT );
font.SetWeight( wxNORMAL );
font.SetPointSize( 8 );
#ifdef __WXMSW__
font.RealizeResource();
#endif
mAboutBox.Center( wxBOTH );
mAboutBox.Show(TRUE);
}
void MyFrame::OnChar( wxKeyEvent& event )
{
wxCommandEvent evt;
if ( event.m_keyCode == WXK_F1 )
{
this->OnFirst( evt );
}
else
{
if ( event.m_keyCode == WXK_F2 )
{
this->OnSecond( evt );
}
else
{
if ( event.m_keyCode == WXK_F3 )
{
this->OnThird( evt );
}
if ( event.m_keyCode == WXK_F4 && !event.AltDown() )
{
// "AI" :-)
wxMessageBox("There are only 3 layouts in this demo :-(");
}
else
{
if ( event.m_keyCode == WXK_TAB )
{
// USEFUL TRICK:: avoids flickering of application's frame
// when closing NN windows on exit:
this->Show(FALSE);
if ( (mAutoSave && mSavedAlready) || !mAutoSave )
{
}
else
{
wxCommandEvent evt;
this->OnStore(evt);
}
Destroy();
}
else
{
event.Skip();
}
}
}
}
}
void MyFrame::OnSayItsOk( wxCommandEvent& event )
{
wxMessageBox("It's OK :-)\n\n now click on the border around the button\n and try dragging it!" );
}
void MyFrame::OnBtnYes( wxCommandEvent& event )
{
mAboutBox.Show(FALSE);
}
void MyFrame::OnBtnNo( wxCommandEvent& event )
{
mAboutBox.Show(FALSE);
}
void MyFrame::OnBtnEsc( wxCommandEvent& event )
{
mAboutBox.Show(FALSE);
}
/*** helper methods ***/
void MyFrame::InitAboutBox()
{
wxPanel* pArea = new wxPanel();
pArea->Create( &mAboutBox, -1 );
new wxStaticText(pArea, -1, "This is wxFrameLayout contribution demo.",
wxPoint(10, 10) );
new wxStaticText(pArea, -1, "Aleksandras Gluchovas (c) 1998",
wxPoint(10, 30) );
new wxStaticText(pArea, -1, "<mailto:alex@soften.ktu.lt>",
wxPoint(10, 50) );
mpAboutBoxLayout = new wxFrameLayout( &mAboutBox, pArea, TRUE );
wxFrameLayout& layout = *mpAboutBoxLayout;
cbDimInfo sizes( 90,40, // when docked horizontally
45,55, // when docked vertically
90,40, // when floated
TRUE, 4, 4 // true - bar is fixed-size
);
wxButton* pYes = CreateButton("&Yes", &mAboutBox, ID_SAY_ITSOK );
wxButton* pNo = CreateButton("&No", &mAboutBox, ID_BTN_NO );
wxButton* pEsc = CreateButton("Cancel", &mAboutBox, ID_BTN_ESC );
layout.AddBar( pEsc, sizes, FL_ALIGN_BOTTOM, 0, 20, "cancel button");
layout.AddBar( pNo, sizes, FL_ALIGN_BOTTOM, 0, 20, "no button");
layout.AddBar( pYes, sizes, FL_ALIGN_BOTTOM, 0, 20, "yes button");
layout.mBorderPen.SetColour( 192, 192, 192 );
layout.SetMargins( 15, 15, 15, 15, wxALL_PANES );
cbCommonPaneProperties props;
layout.GetPaneProperties( props, FL_ALIGN_TOP );
props.mShow3DPaneBorderOn = FALSE;
layout.SetPaneProperties( props, wxALL_PANES );
layout.Activate();
pYes->SetDefault();
pYes->SetFocus();
}
wxTextCtrl* MyFrame::CreateTxtCtrl( const wxString& txt, wxWindow* parent )
{
return new wxTextCtrl( (parent != NULL ) ? parent : mpInternalFrm,
-1, txt, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE );
}
wxButton* MyFrame::CreateButton( const wxString& label,
wxWindow* pParent, long id )
{
return new wxButton( (pParent)?pParent : mpInternalFrm, id,
label, wxPoint( 0,0 ), wxSize( 0,0 ) );
}
wxTreeCtrl* MyFrame::CreateTreeCtrl( const wxString& label )
{
wxTreeCtrl* pTree = new wxTreeCtrl( mpInternalFrm, -1 );
int rootid = pTree->AppendItem( (long)0, label, 0);
if ( label[0] != 'X' )
{
pTree->AppendItem(rootid, "Leaf1", 0);
pTree->AppendItem(rootid, "Leaf2", 0);
}
else
{
pTree->AppendItem(rootid, "Scully", 0);
pTree->AppendItem(rootid, "Mulder", 0);
}
return pTree;
}
wxChoice* MyFrame::CreateChoice( const wxString& txt )
{
wxString choice_strings[5];
choice_strings[0] = txt;
choice_strings[1] = "Julian";
choice_strings[2] = "Hattie";
choice_strings[3] = "Ken";
choice_strings[4] = "Dick";
wxChoice *choice = new wxChoice( mpInternalFrm, 301, wxDefaultPosition,
wxDefaultSize, 5, choice_strings);
choice->SetSelection(0);
return choice;
}
// helper
void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent )
{
cbDimInfo sizes2( 275,38, // when docked horizontally
45,275, // when docked vertically
80,30, // when floated
TRUE, // the bar is fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
cbDimInfo sizes3( 275,55, // when docked horizontally
275,60, // when docked vertically
45,130, // when floated
TRUE, // the bar is fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
cbDimInfo sizes4( 430,35, // when docked horizontally
44,375, // when docked vertically
80,100, // when floated
TRUE, // the bar is fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
wxDynamicToolBar* pTBar2 = new wxDynamicToolBar( mpInternalFrm, -1 );
wxChoice* pChoice = new wxChoice( pTBar2, -1, wxDefaultPosition, wxSize( 140,25 ) );
pTBar2->AddTool( 1, pChoice );
pTBar2->AddTool( 2, BMP_DIR "search.bmp" );
//pTBar2->AddSeparator();
pTBar2->AddTool( 3, BMP_DIR "bookmarks.bmp" );
pTBar2->AddTool( 4, BMP_DIR "nextmark.bmp" );
pTBar2->AddTool( 5, BMP_DIR "prevmark.bmp" );
wxDynamicToolBar* pTBar3 = new wxDynamicToolBar( mpInternalFrm, -1 );
pTBar3->AddTool( 1, BMP_DIR "open.bmp", wxBITMAP_TYPE_BMP, " Open " );
pTBar3->AddTool( 2, BMP_DIR "save.bmp", wxBITMAP_TYPE_BMP, " Save " );
pTBar3->AddTool( 3, BMP_DIR "saveall.bmp", wxBITMAP_TYPE_BMP, " Save All " );
//pTBar3->AddSeparator();
pTBar3->AddTool( 4, BMP_DIR "cut.bmp", wxBITMAP_TYPE_BMP, " Open " );
pTBar3->AddTool( 5, BMP_DIR "copy.bmp", wxBITMAP_TYPE_BMP, " Copy " );
pTBar3->AddTool( 6, BMP_DIR "paste.bmp", wxBITMAP_TYPE_BMP, " Paste " );
#ifdef __WXMSW__
pTBar3->EnableTool( 2, FALSE );
#endif
wxDynamicToolBar* pTBar4 = new wxDynamicToolBar( mpInternalFrm, -1 );
pTBar4->AddTool( 1, BMP_DIR "bookmarks.bmp", wxBITMAP_TYPE_BMP, "Bookmarks ", TRUE );
pTBar4->AddTool( 2, BMP_DIR "nextmark.bmp", wxBITMAP_TYPE_BMP, "Next bookmark ", TRUE );
pTBar4->AddTool( 3, BMP_DIR "prevmark.bmp", wxBITMAP_TYPE_BMP, "Prev bookmark ", TRUE );
//pTBar4->AddSeparator();
pTBar4->AddTool( 4, BMP_DIR "search.bmp", wxBITMAP_TYPE_BMP, "Search ", TRUE );
#ifdef __WXMSW__
pTBar4->EnableTool( 4, FALSE );
#endif
layout.AddBar( pTBar2,
sizes2, FL_ALIGN_TOP,
0,
0,
"Search",
TRUE
);
layout.AddBar( pTBar3,
sizes3, FL_ALIGN_BOTTOM,
0,
0,
"Titled",
TRUE
);
layout.AddBar( pTBar4,
sizes4, FL_ALIGN_BOTTOM,
1,
0,
"Bookmarks",
TRUE
);
}
wxWindow* MyFrame::CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent )
{
bool isNested = (pParent != mpInternalFrm);
// check if we're craeting nested layout
if ( isNested )
{
layout.mBorderPen.SetColour( 128,255,128 );
// if so, than make border smaller
for( int i = 0; i != MAX_PANES; ++i )
{
cbDockPane& pane = *layout.GetPane( i );
pane.mTopMargin = 5;
pane.mBottomMargin = 5;
pane.mLeftMargin = 5;
pane.mRightMargin = 5;
}
}
int cbWidth = 200;
int cbHeight = ( isNested ) ? 50 : 150;
cbDimInfo sizes4( cbWidth,cbHeight,
cbWidth,cbHeight,
cbWidth,cbHeight, FALSE );
cbWidth = 75;
cbHeight = 31;
cbDimInfo sizes5( cbWidth,cbHeight,
42,65,
cbWidth,cbHeight, TRUE,
3, // vertical gap (bar border)
3 // horizontal gap (bar border)
);
// create "workplace" window in the third layout
// SEB: originally here was a wxpp (wxWorkshop) class demotrated
// wxTabbedWindow* pMiniTabArea = new wxTabbedWindow();
// pMiniTabArea->Create( pParent, -1 );
wxTreeCtrl* pClassView = new wxTreeCtrl( pParent, -1,
wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS );
pClassView->SetImageList( &mImageList );
wxTreeItemId rootId = pClassView->AddRoot( "wxWindows 2.0 classes", 0 );
pClassView->AppendItem( rootId, "wxWin Dynamic classes (grabbed at run-time)", 0 );
pClassView->AppendItem( rootId, "serializer-classes (grabbed at run-time)", 0 );
// now create "output" window
wxNotebook* pTabbedArea = new wxNotebook(pParent, -1);
// SEB: originally here was a wxpp (wxWorkshop) class used
// wxPaggedWindow* pTabbedArea = new wxPaggedWindow();
// pTabbedArea->Create( pParent, -1 );
wxPanel* pSheet3 = new wxPanel();
pSheet3->Create( pTabbedArea, -1 );
pSheet3->Show(FALSE);
pTabbedArea->AddPage( CreateTxtCtrl("build", pTabbedArea), "Build");
pTabbedArea->AddPage( CreateTxtCtrl("debug", pTabbedArea), "Debug");
pTabbedArea->AddPage( pSheet3, "is THIS recursive - or what !?");
pTabbedArea->AddPage( CreateTxtCtrl("profile", pTabbedArea), "Profile");
layout.AddBar( new StartButton95(pParent), sizes5, FL_ALIGN_TOP, 0, 0, "Start..." );
layout.AddBar( pClassView, sizes4, FL_ALIGN_LEFT, 0, 0, "Project Workplace" );
layout.AddBar( pTabbedArea, sizes4, FL_ALIGN_BOTTOM, 0, 50, "Output" );
return pSheet3;
}
void MyFrame::DropInSomeBars( int layoutNo )
{
/* create once... and forget! */
// setup dimension infos for various bar shapes
int cbWidth = 90;
int cbHeight = 30;
if ( layoutNo == SECOND_LAYOUT )
cbHeight = 60;
wxFrameLayout& layout = *mLayouts[layoutNo];
cbDimInfo sizes( cbWidth,cbHeight, // when docked horizontally
cbWidth,cbHeight, // when docked vertically
cbWidth,cbHeight, // when floated
TRUE // true - bar is fixed-size
);
cbWidth = 120;
cbDimInfo sizes1( cbWidth,cbHeight,
cbWidth,cbHeight,
cbWidth,cbHeight, FALSE ); // false - bar is "flexible"
cbWidth = 120;
cbHeight = 40;
cbDimInfo sizes3( cbWidth,cbHeight,
cbWidth,cbHeight,
cbWidth,cbHeight, TRUE ); // -/-
cbWidth = 200;
cbHeight = 150;
cbDimInfo sizes4( cbWidth,cbHeight,
cbWidth,cbHeight,
cbWidth,cbHeight, FALSE ); // -/-
cbWidth = 63;
cbHeight = 31;
cbDimInfo sizes5( cbWidth,cbHeight,
cbHeight,cbWidth,
cbWidth,cbHeight, TRUE,
3, // vertical gap (bar border)
3 // horizontal gap (bar border)
); // -/-
if ( layoutNo == FIRST_LAYOUT )
{
// add 4 fixed-size bars (`sizes' dim-info) and one "flexible" (with `sizes1' dim-info)
wxWindow* pGreenOne = new MyTestPanel(mpInternalFrm);
pGreenOne->SetBackgroundColour( wxColour(128,255,128) );
layout.AddBar( pGreenOne, sizes, FL_ALIGN_TOP, 0, 50, "Bar1", TRUE );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_TOP, 2, 50, "Bar2", TRUE );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_BOTTOM, 2, 50, "Bar3", TRUE );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes, FL_ALIGN_LEFT, 2, 50, "Bar4", TRUE );
layout.AddBar( new MyTestPanel(mpInternalFrm), sizes1, wxCBAR_HIDDEN, 2, 50, "Super-Bar", TRUE );
}
else
{
if ( layoutNo == SECOND_LAYOUT )
{
// show off various wx-controls in the second layout
layout.AddBar( CreateTxtCtrl(), sizes, FL_ALIGN_TOP, 0, 50, "Fixed text Area&0" );
layout.AddBar( CreateButton("OK"), sizes, FL_ALIGN_TOP, 0, 100, "First Button" );
layout.AddBar( CreateTxtCtrl(), sizes1, FL_ALIGN_BOTTOM, 0, 50, "First Tree" );
layout.AddBar( CreateTreeCtrl("Root"), sizes1, FL_ALIGN_LEFT, 0, 0, "TreeCtrl Window" );
layout.AddBar( CreateChoice("Choice 1"), sizes3, FL_ALIGN_TOP, 0, 0, "Choice 1 (buggy)", FALSE, wxCBAR_HIDDEN );
layout.AddBar( CreateChoice("Choice 2"), sizes3, FL_ALIGN_TOP, 0, 0, "Choice 2 (buggy)", FALSE, wxCBAR_HIDDEN );
layout.AddBar( CreateTreeCtrl("X-Files"), sizes1, FL_ALIGN_RIGHT, 0, 100, "X-Files" );
layout.AddBar( CreateTxtCtrl("smaller1"), sizes3, FL_ALIGN_TOP, 0, 50, "smaller Area1" );
layout.AddBar( CreateTxtCtrl("smaller2"), sizes3, FL_ALIGN_TOP, 0, 50, "sm&ller Area2" );
}
else
{
if ( layoutNo == THIRD_LAYOUT )
{
#ifdef __WXGTK__
cbCommonPaneProperties props;
layout.GetPaneProperties( props );
props.mRealTimeUpdatesOn = FALSE; // real-time OFF for gtk!!!
layout.SetPaneProperties( props, wxALL_PANES );
#endif
layout.AddBar( CreateTxtCtrl("Tool1"), sizes3, FL_ALIGN_TOP, 0, 50, "Fixed text Area1" );
layout.AddBar( CreateTxtCtrl("Tool2"), sizes3, FL_ALIGN_TOP, 0, 50, "Fixed text Area2" );
layout.AddBar( CreateTxtCtrl("Tool3"), sizes3, FL_ALIGN_TOP, 0, 50, "Fixed text Area3" );
layout.AddBar( CreateTxtCtrl("Tool4"), sizes3, FL_ALIGN_TOP, 1, 50, "Fixed text Area4" );
layout.AddBar( CreateTxtCtrl("Tool5"), sizes3, FL_ALIGN_TOP, 1, 50, "Fixed text Area5" );
layout.AddBar( CreateTxtCtrl("Tool6"), sizes3, FL_ALIGN_TOP, 1, 50, "Fixed text Area6" );
layout.AddBar( CreateTxtCtrl("Tool7"), sizes3, FL_ALIGN_TOP, 2,250, "Fixed text Area7" );
cbDimInfo sizes10( 175,35, // when docked horizontally
175,38, // when docked vertically
170,35, // when floated
TRUE, // the bar is not fixed-size
4, // vertical gap (bar border)
4, // horizontal gap (bar border)
new cbDynToolBarDimHandler()
);
wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
pToolBar->Create( mpInternalFrm, -1 );
// 1001-1006 ids of command events fired by added tool-buttons
pToolBar->AddTool( 1001, BMP_DIR "new.bmp" );
pToolBar->AddTool( 1002, BMP_DIR "open.bmp" );
pToolBar->AddTool( 1003, BMP_DIR "save.bmp" );
pToolBar->AddTool( 1004, BMP_DIR "cut.bmp" );
pToolBar->AddTool( 1005, BMP_DIR "copy.bmp" );
pToolBar->AddTool( 1006, BMP_DIR "paste.bmp" );
layout.AddBar( pToolBar, // bar window (can be NULL)
sizes10, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
"Real-Toolbar", // name to refere in customization pop-ups
FALSE
);
// create first "developement" layout
AddSearchToolbars( layout, mpInternalFrm);
wxWindow* pSheet3 = CreateDevLayout( layout, mpInternalFrm);
// create another ***secreat developement*** layout inside
// the third sheet of the outter one's output bar
mpNestedLayout = new wxFrameLayout( pSheet3,
CreateTxtCtrl("\"Mobils in Mobile\" --C.Nemo",pSheet3), FALSE );
CreateDevLayout( *mpNestedLayout, pSheet3 );
mpNestedLayout->Activate();
}
}
}
}
void MyFrame::CreateLayout( int layoutNo )
{
wxFrameLayout* pLayout = new wxFrameLayout( mpInternalFrm, mpClntWindow, FALSE );
if ( layoutNo == THIRD_LAYOUT )
{
pLayout->PushDefaultPlugins();
pLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // facny "X"es and beveal for bars
#ifdef __WXGTK__
pLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
#endif
pLayout->AddPlugin( CLASSINFO( cbRowDragPlugin ) );
}
mLayouts[layoutNo] = pLayout;
DropInSomeBars( layoutNo );
}
void MyFrame::RemoveLayout( int layoutNo )
{
wxFrameLayout* pLayout = mLayouts[layoutNo];
if ( !pLayout )
return;
pLayout->HideBarWindows();
// destroy nested layout first
if ( layoutNo == THIRD_LAYOUT )
{
if ( mpNestedLayout )
delete mpNestedLayout;
mpNestedLayout = NULL;
}
// NOTE:: bar windows are NOT destroyed automatically by frame-layout
pLayout->DestroyBarWindows();
delete pLayout;
mLayouts[layoutNo] = NULL;
Refresh();
}
void MyFrame::SyncMenuBarItems()
{
for( int i = 0; i != MAX_LAYOUTS; ++i )
{
GetMenuBar()->Check( ID_FIRST+i, mActiveLayoutNo == FIRST_LAYOUT+i );
}
GetMenuBar()->Check( ID_AUTOSAVE, mAutoSave );
}
void MyFrame::ActivateLayout( int layoutNo )
{
if ( layoutNo == mActiveLayoutNo )
return;
if ( mLayouts[mActiveLayoutNo] )
mLayouts[mActiveLayoutNo]->Deactivate();
mActiveLayoutNo = layoutNo;
if ( mLayouts[mActiveLayoutNo] )
mLayouts[mActiveLayoutNo]->Activate();
else
Refresh();
SyncMenuBarItems();
}
/***** Implementation for class StartButton95 (just for fun) *****/
IMPLEMENT_DYNAMIC_CLASS( StartButton95, wxPanel )
BEGIN_EVENT_TABLE( StartButton95, wxPanel )
EVT_LEFT_DOWN( StartButton95::OnMouseDown )
EVT_LEFT_UP ( StartButton95::OnMouseUp )
EVT_PAINT ( StartButton95::OnPaint )
END_EVENT_TABLE()
void StartButton95::OnMouseDown( wxMouseEvent& event )
{
m_bPressed = TRUE;
Refresh();
CaptureMouse();
}
void StartButton95::OnMouseUp( wxMouseEvent& event )
{
// "this is not a bug"
SetCursor( wxCURSOR_WAIT );
GetParent()->SetCursor( wxCURSOR_WAIT );
::wxSetCursor( wxCURSOR_WAIT );
wxSleep(1);
int i = 0;
for( i = 1; i != 6; ++i )
{
m_bPressed = (i % 2) != 0;
Refresh();
wxSleep(1);
}
GetParent()->Close();
//*((char*)(i)-3) = 'X'; // Aleks what's the meaning of this???
}
void StartButton95::OnPaint( wxPaintEvent& event )
{
wxBitmap* pBmp = 0;
if ( m_bPressed )
{
if ( !m_PBmp.Ok() && wxFileExists( BMP_DIR "start95_pr.bmp" ) )
m_PBmp.LoadFile( BMP_DIR "start95_pr.bmp", wxBITMAP_TYPE_BMP );
pBmp = &m_PBmp;
}
else
{
if ( !m_DBmp.Ok() && wxFileExists( BMP_DIR "start95_dp.bmp" ) )
m_DBmp.LoadFile( BMP_DIR "start95_dp.bmp", wxBITMAP_TYPE_BMP );
pBmp = &m_DBmp;
}
if (!pBmp) return;
wxMemoryDC mdc;
wxPaintDC dc(this);
mdc.SelectObject( *pBmp );
dc.Blit( 0,0, pBmp->GetWidth(), pBmp->GetHeight(), &mdc, 0,0, wxCOPY );
mdc.SelectObject( wxNullBitmap );
}

View File

@@ -0,0 +1,160 @@
/////////////////////////////////////////////////////////////////////////////
// Name: No names yet.
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by:
// Created: 04/11/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __FLDEMO_G__
#define __FLDEMO_G__
// ID for the menu commands
#define MINIMAL_QUIT 1
#define MINIMAL_ABOUT 102
#define ID_LOAD 103
#define ID_STORE 104
#define ID_AUTOSAVE 105
//#define ID_SETTINGS 106
#define ID_REMOVE 107
#define ID_REMOVEALL 108
#define ID_RECREATE 109
#define ID_ACTIVATE 110
#define ID_FIRST 111
#define ID_SECOND 112
#define ID_THIRD 113
#define ID_SAY_ITSOK 114
#define ID_BTN_YES 115
#define ID_BTN_NO 116
#define ID_BTN_ESC 117
#define MAX_LAYOUTS 3
#define FIRST_LAYOUT 0
#define SECOND_LAYOUT 1
#define THIRD_LAYOUT 2
class wxFrameLayout;
class wxObjectStorage;
// FOR NOW::
typedef wxPanel MyTestPanel;
// Define a new application type
class MyApp: public wxApp
{
public:
bool OnInit(void);
};
// Define a new frame type
class MyFrame: public wxFrame
{
protected:
wxFrameLayout* mLayouts[MAX_LAYOUTS];
wxFrameLayout* mpNestedLayout;
wxFrameLayout* mpAboutBoxLayout;
int mActiveLayoutNo;
bool mAutoSave;
bool mSavedAlready;
// container windows:
wxTextCtrl* mpClntWindow;
wxPanel* mpInternalFrm;
wxImageList mImageList;
wxFrame mAboutBox;
// helpers for control-creation
wxTextCtrl* CreateTxtCtrl ( const wxString& txt = "wxTextCtrl", wxWindow* parent = NULL );
wxTreeCtrl* CreateTreeCtrl( const wxString& label = "TreeCtrl" );
wxChoice* CreateChoice ( const wxString& txt = "Choice1" );
wxButton* CreateButton ( const wxString& label = "wxButton", wxWindow* pParent = NULL, long id = ID_SAY_ITSOK );
// helpers for layout-creation
void AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent );
wxWindow* CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent );
void DropInSomeBars( int layoutNo );
void CreateLayout( int layoutNo );
void RemoveLayout( int layoutNo );
void InitAboutBox();
void ActivateLayout( int layoutNo );
public: /* public */
MyFrame( wxFrame *frame, char *title, int x, int y, int w, int h);
~MyFrame();
void SyncMenuBarItems();
// event handlers
bool OnClose(void);
void OnLoad( wxCommandEvent& event );
void OnStore( wxCommandEvent& event );
void OnAutoSave( wxCommandEvent& event );
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
//void OnSettings( wxCommandEvent& event );
void OnRemove( wxCommandEvent& event );
void OnRemoveAll( wxCommandEvent& event );
void OnRecreate( wxCommandEvent& event );
void OnFirst( wxCommandEvent& event );
void OnSecond( wxCommandEvent& event );
void OnThird( wxCommandEvent& event );
void OnSayItsOk( wxCommandEvent& event );
void OnBtnYes( wxCommandEvent& event );
void OnBtnNo( wxCommandEvent& event );
void OnBtnEsc( wxCommandEvent& event );
void OnChar( wxKeyEvent& event );
DECLARE_EVENT_TABLE()
};
// Define a new button type, StartButton95 (Just for fun)
class StartButton95 : public wxPanel
{
DECLARE_DYNAMIC_CLASS( StartButton95 )
bool m_bPressed;
wxBitmap m_PBmp;
wxBitmap m_DBmp;
public:
StartButton95(void) : m_bPressed(FALSE) {}
StartButton95(wxWindow* parent)
: m_bPressed(FALSE) { wxPanel::Create(parent,-1); }
void OnMouseDown( wxMouseEvent& event );
void OnMouseUp( wxMouseEvent& event );
void OnPaint( wxPaintEvent& event );
DECLARE_EVENT_TABLE();
};
#endif

View File

@@ -0,0 +1,3 @@
/* mondrian ICON "mondrian.ico" */
#include "wx/msw/wx.rc"

View File

@@ -0,0 +1,23 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds sample for 32-bit BC++
WXDIR = ..\..\..\..
TARGET = fl_demo2
EXTRACPPFLAGS =-DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WSLIBDIR)\fl.lib
!else
EXTRALIBS = $(WSLIBDIR)\fld.lib
!endif
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32

View File

@@ -0,0 +1,18 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile for wxWorkshop for mingw & cygwin.
WXDIR = ../../../..
TARGET = fl_demo2
EXTRACPPFLAGS = -DBMP_DIR=\"../bitmaps/\"
EXTRALIBS = $(WXDIR)/lib/libfl.a
OBJECTS = $(TARGET).o
include $(WXDIR)/src/makeprog.g95

View File

@@ -0,0 +1,24 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds fl sample (VC++, WIN32)
# Use FINAL=1 argument to nmake to build final version with no debug info.
WXDIR = ..\..\..\..
TARGET = fl_demo2
EXTRAINC = -DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WXDIR)\lib\fl.lib
!else
EXTRALIBS = $(WXDIR)\lib\fld.lib
!endif
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.vc

View File

@@ -0,0 +1,25 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# "%W% %G%"
#
# Makefile : Builds sample on UNIX/Linux.
top_srcdir = @top_srcdir@/..
top_builddir = ../../../..
TARGET = fl_sample1
program_dir = contrib/samples/fl/$(TARGET)
APPEXTRADEFS = -I$(top_srcdir)/contrib/include -DBMP_DIR=\"../bitmaps/\"
APPEXTRALIBS = $(top_builddir)/lib/libfl.@WX_TARGET_LIBRARY_TYPE@
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).o
include $(top_builddir)/src/makeprog.env

View File

@@ -0,0 +1,108 @@
# Microsoft Developer Studio Project File - Name="fl_sample1" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=fl_sample1 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak" CFG="fl_sample1 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "fl_sample1 - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "fl_sample1 - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "fl_sample1 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../../include" /I "../../../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib fl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"../../lib" /libpath:"../../contrib/lib"
!ELSEIF "$(CFG)" == "fl_sample1 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../../../contrib/include" /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib fld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib"
!ENDIF
# Begin Target
# Name "fl_sample1 - Win32 Release"
# Name "fl_sample1 - Win32 Debug"
# Begin Source File
SOURCE=.\fl_sample1.cpp
!IF "$(CFG)" == "fl_sample1 - Win32 Release"
!ELSEIF "$(CFG)" == "fl_sample1 - Win32 Debug"
# ADD CPP /Yc"wx/wxprec.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\fl_sample1.rc
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "fl_sample1"=.\fl_demo.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,196 @@
/////////////////////////////////////////////////////////////////////////////
// Name: fl_sample1.cpp
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by: Sebastian Haase (June 21, 2001)
// Created: 24/11/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/textctrl.h"
// fl headers
#include "wx/fl/controlbar.h"
// plugins used
#include "wx/fl/barhintspl.h"
#include "wx/fl/hintanimpl.h"
#define ID_LOAD 102
#define ID_STORE 103
#define ID_QUIT 104
class MyApp: public wxApp
{
public:
bool OnInit(void);
};
class MyFrame: public wxFrame
{
protected:
wxFrameLayout* mpLayout;
wxWindow* mpClientWnd;
wxPanel* mpInternalFrm;
wxTextCtrl* CreateTextCtrl( const wxString& value );
public:
MyFrame( wxWindow* parent, char *title );
~MyFrame();
void OnLoad( wxCommandEvent& event );
void OnStore( wxCommandEvent& event );
void OnQuit( wxCommandEvent& event );
bool OnClose(void) { return TRUE; }
DECLARE_EVENT_TABLE()
};
/***** Implementation for class MyApp *****/
IMPLEMENT_APP (MyApp)
bool MyApp::OnInit(void)
{
// wxWindows boiler-plate:
MyFrame *frame = new MyFrame(NULL, "wxFrameLayout sample");
wxMenu *file_menu = new wxMenu;
file_menu->Append( ID_LOAD, "&Load layout" );
file_menu->Append( ID_STORE, "&Store layout" );
file_menu->AppendSeparator();
file_menu->Append( ID_QUIT, "E&xit" );
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, "&File");
frame->CreateStatusBar(3);
frame->SetMenuBar(menu_bar);
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
/***** Immlementation for class MyFrame *****/
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU( ID_LOAD, MyFrame::OnLoad )
EVT_MENU( ID_STORE, MyFrame::OnStore )
EVT_MENU( ID_QUIT, MyFrame::OnQuit )
END_EVENT_TABLE()
MyFrame::MyFrame( wxWindow* parent, char *title )
: wxFrame( parent, -1, "NewTest-II", wxDefaultPosition,
wxSize( 700, 500 ),
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
"freimas" )
{
mpInternalFrm = (wxPanel*)this;
mpClientWnd = CreateTextCtrl( "Client window" );
// btw, creation of internal frame is needed for wxGtk version
// to act correctly (since menu-bar is a separate window there..)
mpLayout = new wxFrameLayout( mpInternalFrm, mpClientWnd );
#ifdef __WXGTK__
// real-time dosn't work well under wxGtk yet
cbCommonPaneProperties props;
mpLayout->GetPaneProperties( props );
props.mRealTimeUpdatesOn = FALSE; // off
mpLayout->SetPaneProperties( props, wxALL_PANES );
#endif
mpLayout->PushDefaultPlugins();
mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // facny "X"es and beveal for barso
//mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
cbDimInfo sizes( 80,65, // when docked horizontally
80,65, // when docked vertically
80,30, // when floated
TRUE, // the bar is fixed-size
5, // vertical gap (bar border)
5 // horizontal gap (bar border)
);
// drop-in 20 bars
for( int i = 1; i <= 20; ++i )
{
char buf[4];
sprintf( buf, "%d", i );
wxString name = wxString("Bar-");
name += buf;
sizes.mIsFixed = i % 5 > 0; // every fifth bar is not fixed-size
if ( !sizes.mIsFixed ) name += " (flexible)";
mpLayout->AddBar( CreateTextCtrl(name),// bar window
sizes, i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
name // name to refere in customization pop-ups
);
}
}
MyFrame::~MyFrame()
{
// layout is not a window, should be released manually
if ( mpLayout )
delete mpLayout;
}
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
{
wxTextCtrl* pCtrl = new wxTextCtrl( mpInternalFrm, -1, value,
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
return pCtrl;
}
void MyFrame::OnLoad( wxCommandEvent& event )
{
wxMessageBox("Hey - you found a BIG question-mark !!");
}
void MyFrame::OnStore( wxCommandEvent& event )
{
wxMessageBox("Hey - you found another BIG question-mark !!");
}
void MyFrame::OnQuit( wxCommandEvent& event )
{
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
Close(TRUE);
}

View File

@@ -0,0 +1,3 @@
/* mondrian ICON "mondrian.ico" */
#include "wx/msw/wx.rc"

View File

@@ -0,0 +1,23 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds sample for 32-bit BC++
WXDIR = ..\..\..\..
TARGET = fl_sample1
EXTRACPPFLAGS =-DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WSLIBDIR)\fl.lib
!else
EXTRALIBS = $(WSLIBDIR)\fld.lib
!endif
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32

View File

@@ -0,0 +1,18 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile for wxWorkshop for mingw & cygwin.
WXDIR = ../../../..
TARGET = fl_sample1
EXTRACPPFLAGS = -DBMP_DIR=\"../bitmaps/\"
EXTRALIBS = $(WXDIR)/lib/libfl.a
OBJECTS = $(TARGET).o
include $(WXDIR)/src/makeprog.g95

View File

@@ -0,0 +1,24 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds fl sample (VC++, WIN32)
# Use FINAL=1 argument to nmake to build final version with no debug info.
WXDIR = ..\..\..\..
TARGET = fl_sample1
EXTRAINC = -DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WXDIR)\lib\fl.lib
!else
EXTRALIBS = $(WXDIR)\lib\fld.lib
!endif
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.vc

View File

@@ -0,0 +1,25 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# "%W% %G%"
#
# Makefile : Builds sample on UNIX/Linux.
top_srcdir = @top_srcdir@/..
top_builddir = ../../../..
TARGET = fl_sample2
program_dir = contrib/samples/fl/$(TARGET)
APPEXTRADEFS = -I$(top_srcdir)/contrib/include -DBMP_DIR=\"../bitmaps/\"
APPEXTRALIBS = $(top_builddir)/lib/libfl.@WX_TARGET_LIBRARY_TYPE@
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).o
include $(top_builddir)/src/makeprog.env

View File

@@ -0,0 +1,108 @@
# Microsoft Developer Studio Project File - Name="fl_sample2" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=fl_sample2 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak" CFG="fl_sample2 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "fl_sample2 - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "fl_sample2 - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "fl_sample2 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../../include" /I "../../../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib fl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"../../lib" /libpath:"../../contrib/lib"
!ELSEIF "$(CFG)" == "fl_sample2 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../../../contrib/include" /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib fld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib"
!ENDIF
# Begin Target
# Name "fl_sample2 - Win32 Release"
# Name "fl_sample2 - Win32 Debug"
# Begin Source File
SOURCE=.\fl_sample2.cpp
!IF "$(CFG)" == "fl_sample2 - Win32 Release"
!ELSEIF "$(CFG)" == "fl_sample2 - Win32 Debug"
# ADD CPP /Yc"wx/wxprec.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\fl_sample2.rc
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "fl_sample2"=.\fl_demo.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,194 @@
/////////////////////////////////////////////////////////////////////////////
// Name: fl_sample2.cpp
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by: Sebastian Haase (June 21, 2001)
// Created: 24/11/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/textctrl.h"
// fl headers
#include "wx/fl/controlbar.h"
// plugins used
#include "wx/fl/barhintspl.h"
#include "wx/fl/hintanimpl.h"
#define ID_LOAD 102
#define ID_STORE 103
#define ID_QUIT 104
class MyApp: public wxApp
{
public:
bool OnInit(void);
};
class MyFrame: public wxFrame
{
protected:
wxFrameLayout* mpLayout;
wxWindow* mpClientWnd;
wxTextCtrl* CreateTextCtrl( const wxString& value );
public:
MyFrame( wxWindow* parent, char *title );
~MyFrame();
void populateMyFrame();
void OnLoad( wxCommandEvent& event );
void OnStore( wxCommandEvent& event );
void OnQuit( wxCommandEvent& event );
bool OnClose(void) { return TRUE; }
DECLARE_EVENT_TABLE()
};
/***** Implementation for class MyApp *****/
IMPLEMENT_APP (MyApp)
bool MyApp::OnInit(void)
{
// wxWindows boiler-plate:
MyFrame *frame = new MyFrame(NULL, "wxFrameLayout sample");
wxMenu *file_menu = new wxMenu;
file_menu->Append( ID_LOAD, "&Load layout" );
file_menu->Append( ID_STORE, "&Store layout" );
file_menu->AppendSeparator();
file_menu->Append( ID_QUIT, "E&xit" );
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, "&File");
frame->CreateStatusBar(3);
frame->SetMenuBar(menu_bar);
frame->Show(TRUE);
SetTopWindow(frame);
frame->populateMyFrame();
return TRUE;
}
/***** Immlementation for class MyFrame *****/
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU( ID_LOAD, MyFrame::OnLoad )
EVT_MENU( ID_STORE, MyFrame::OnStore )
EVT_MENU( ID_QUIT, MyFrame::OnQuit )
END_EVENT_TABLE()
MyFrame::MyFrame( wxWindow* parent, char *title )
: wxFrame( parent, -1, "NewTest-II", wxDefaultPosition,
wxSize( 700, 500 ),
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
"freimas" )
{
}
void MyFrame::populateMyFrame()
{
mpClientWnd = CreateTextCtrl( "Client window" );
mpLayout = new wxFrameLayout( this, mpClientWnd );
/// mpLayout->PushDefaultPlugins();
/// mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // facny "X"es and beveal for barso
/// //mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
cbDimInfo sizes( 80,65, // when docked horizontally
80,165, // when docked vertically
180,30, // when floated
TRUE, // the bar is fixed-size
5, // vertical gap (bar border)
5 // horizontal gap (bar border)
);
// drop-in 20 bars
for( int i = 1; i <= 10; ++i )
{
wxSleep(1);
wxYield(); // CHECK!
char buf[4];
sprintf( buf, "%d", i );
wxString name = wxString("Bar-");
name += buf;
//sizes.mIsFixed = i % 2 > 0; // every fifth bar is not fixed-size
if ( !sizes.mIsFixed ) name += " (flexible)";
// mpLayout->AddBar( CreateTextCtrl(name),// bar window
mpLayout->AddBar( new wxTextCtrl(this, -1, name),// bar window
sizes, i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
name // name to refere in customization pop-ups
);
mpLayout->RecalcLayout(true);
// Layout();
// Refresh();
}
}
MyFrame::~MyFrame()
{
// layout is not a window, should be released manually
if ( mpLayout )
delete mpLayout;
}
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
{
wxTextCtrl* pCtrl = new wxTextCtrl( this, -1, value,
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
return pCtrl;
}
void MyFrame::OnLoad( wxCommandEvent& event )
{
wxMessageBox("Hey - you found a BIG question-mark !!");
}
void MyFrame::OnStore( wxCommandEvent& event )
{
wxMessageBox("Hey - you found another BIG question-mark !!");
}
void MyFrame::OnQuit( wxCommandEvent& event )
{
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
Close(TRUE);
}

View File

@@ -0,0 +1,3 @@
/* mondrian ICON "mondrian.ico" */
#include "wx/msw/wx.rc"

View File

@@ -0,0 +1,23 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds sample for 32-bit BC++
WXDIR = ..\..\..\..
TARGET = fl_sample2
EXTRACPPFLAGS =-DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WSLIBDIR)\fl.lib
!else
EXTRALIBS = $(WSLIBDIR)\fld.lib
!endif
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32

View File

@@ -0,0 +1,18 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile for wxWorkshop for mingw & cygwin.
WXDIR = ../../../..
TARGET = fl_sample2
EXTRACPPFLAGS = -DBMP_DIR=\"../bitmaps/\"
EXTRALIBS = $(WXDIR)/lib/libfl.a
OBJECTS = $(TARGET).o
include $(WXDIR)/src/makeprog.g95

View File

@@ -0,0 +1,24 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds fl sample (VC++, WIN32)
# Use FINAL=1 argument to nmake to build final version with no debug info.
WXDIR = ..\..\..\..
TARGET = fl_sample2
EXTRAINC = -DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WXDIR)\lib\fl.lib
!else
EXTRALIBS = $(WXDIR)\lib\fld.lib
!endif
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.vc

View File

@@ -0,0 +1,25 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# "%W% %G%"
#
# Makefile : Builds sample on UNIX/Linux.
top_srcdir = @top_srcdir@/..
top_builddir = ../../../..
TARGET = fl_sample3
program_dir = contrib/samples/fl/$(TARGET)
APPEXTRADEFS = -I$(top_srcdir)/contrib/include -DBMP_DIR=\"../bitmaps/\"
APPEXTRALIBS = $(top_builddir)/lib/libfl.@WX_TARGET_LIBRARY_TYPE@
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).o
include $(top_builddir)/src/makeprog.env

View File

@@ -0,0 +1,108 @@
# Microsoft Developer Studio Project File - Name="fl_sample3" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=fl_sample3 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "fl_demo.mak" CFG="fl_sample3 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "fl_sample3 - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "fl_sample3 - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "fl_sample3 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../../include" /I "../../../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib fl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"../../lib" /libpath:"../../contrib/lib"
!ELSEIF "$(CFG)" == "fl_sample3 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../../../contrib/include" /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /D BMP_DIR=\"../bitmaps/\" /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib fld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib"
!ENDIF
# Begin Target
# Name "fl_sample3 - Win32 Release"
# Name "fl_sample3 - Win32 Debug"
# Begin Source File
SOURCE=.\fl_sample3.cpp
!IF "$(CFG)" == "fl_sample3 - Win32 Release"
!ELSEIF "$(CFG)" == "fl_sample3 - Win32 Debug"
# ADD CPP /Yc"wx/wxprec.h"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\fl_sample3.rc
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "fl_sample3"=.\fl_demo.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -0,0 +1,337 @@
/////////////////////////////////////////////////////////////////////////////
// Name: fl_sample3.cpp
// Purpose: Contrib. demo
// Author: Aleksandras Gluchovas
// Modified by: Sebastian Haase (June 21, 2001)
// Created: 24/11/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/textctrl.h"
// fl headers
#include "wx/fl/controlbar.h"
// plugins used
#include "wx/fl/barhintspl.h"
#include "wx/fl/hintanimpl.h"
#define ID_LOAD 102
#define ID_STORE 103
#define ID_QUIT 104
#define ID_BUTT 145
#define ID_BUTT2 146
class MyApp: public wxApp
{
public:
bool OnInit(void);
};
class MyFrame: public wxFrame
{
protected:
wxFrameLayout* mpLayout;
wxWindow* mpClientWnd;
wxButton * my_butt;
wxTextCtrl* CreateTextCtrl( const wxString& value );
public:
MyFrame( wxWindow* parent, char *title );
~MyFrame();
void OnLoad( wxCommandEvent& event );
void OnStore( wxCommandEvent& event );
void OnQuit( wxCommandEvent& event );
void OnButt( wxCommandEvent& event );
void OnButt2( wxCommandEvent& event );
bool OnClose(void) { return TRUE; }
DECLARE_EVENT_TABLE()
};
/***** Implementation for class MyApp *****/
IMPLEMENT_APP (MyApp)
bool MyApp::OnInit(void)
{
// wxWindows boiler-plate:
MyFrame *frame = new MyFrame(NULL, "wxFrameLayout sample");
wxMenu *file_menu = new wxMenu;
file_menu->Append( ID_LOAD, "&Load layout" );
file_menu->Append( ID_STORE, "&Store layout" );
file_menu->AppendSeparator();
file_menu->Append( ID_QUIT, "E&xit" );
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, "&File");
frame->CreateStatusBar(3);
frame->SetMenuBar(menu_bar);
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
/***** Immlementation for class MyFrame *****/
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU( ID_LOAD, MyFrame::OnLoad )
EVT_MENU( ID_STORE, MyFrame::OnStore )
EVT_MENU( ID_QUIT, MyFrame::OnQuit )
EVT_BUTTON( ID_BUTT, MyFrame::OnButt )
EVT_BUTTON( ID_BUTT2, MyFrame::OnButt2 )
END_EVENT_TABLE()
MyFrame::MyFrame( wxWindow* parent, char *title )
: wxFrame( parent, -1, "NewTest-II", wxDefaultPosition,
wxSize( 700, 500 ),
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
"freimas" )
{
mpClientWnd = new wxWindow(this, -1);
mpLayout = new wxFrameLayout( this, mpClientWnd );
/// mpLayout->PushDefaultPlugins();
/// mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // facny "X"es and beveal for barso
/// //mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
cbDimInfo sizes( 80,65, // when docked horizontally
80,165, // when docked vertically
180,30, // when floated
TRUE, // the bar is fixed-size
5, // vertical gap (bar border)
5 // horizontal gap (bar border)
);
// drop-in some bars
for( int i = 1; i <= 11; ++i )
{
char buf[4];
sprintf( buf, "%d", i );
wxString name = wxString("Bar-");
name += buf;
sizes.mIsFixed = (i !=3); // every fifth bar is not fixed-size
if ( !sizes.mIsFixed ) name += " (flexible)";
// mpLayout->AddBar( CreateTextCtrl(name),// bar window
if(i != 4 && i!= 5 && i!=11) {
mpLayout->AddBar( new wxTextCtrl(this, -1, name),// bar window
sizes,
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
name // name to refere in customization pop-ups
);
} else if(i==4){
mpLayout->AddBar( new wxTextCtrl(this, -1, name),// bar window
cbDimInfo( 100,100, 100,100, 100,100, TRUE, 5, 5),
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
name // name to refere in customization pop-ups
);
} else if(i==5) {
my_butt = new wxButton(this, ID_BUTT, name);
mpLayout->AddBar( my_butt,// bar window
cbDimInfo( 100,100, 200,200, 400,400, TRUE, 5, 5),
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
name // name to refere in customization pop-ups
);
} else if(i==11) {
mpLayout->AddBar( new wxButton(this, ID_BUTT2, name+"_2"),
cbDimInfo( 100,100, 200,200, 400,400, TRUE, 5, 5),
i % MAX_PANES,// alignment ( 0-top,1-bottom, etc)
0, // insert into 0th row (vert. position)
0, // offset from the start of row (in pixels)
name // name to refere in customization pop-ups
);
}
// mpLayout->RecalcLayout(true);
// Layout();
// Refresh();
}
}
MyFrame::~MyFrame()
{
// layout is not a window, should be released manually
if ( mpLayout )
delete mpLayout;
}
wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
{
wxTextCtrl* pCtrl = new wxTextCtrl( this, -1, value,
wxPoint(0,0), wxSize(1,1), wxTE_MULTILINE );
pCtrl->SetBackgroundColour( wxColour( 255,255,255 ) );
return pCtrl;
}
void MyFrame::OnLoad( wxCommandEvent& event )
{
wxMessageBox("Hey - you found a BIG question-mark !!");
}
void MyFrame::OnStore( wxCommandEvent& event )
{
wxMessageBox("Hey - you found another BIG question-mark !!");
}
void MyFrame::OnQuit( wxCommandEvent& event )
{
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
Close(TRUE);
}
void MyFrame::OnButt( wxCommandEvent& event )
{
static int i =0;
// cbBarInfo* FindBarByName( const wxString& name );
switch(i % 2) {
case 0:
{
cbBarInfo* x = mpLayout->FindBarByName(wxString("Bar-1"));
if(x)
mpLayout->InverseVisibility(x);
else
wxBell();
break;
}
case 1:
{
cbBarInfo* x = mpLayout->FindBarByName(wxString("Bar-6"));
if(x)
{
if(i % 4 == 1)
{
mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE);
//mpLayout->RecalcLayout(true);
mpLayout->RepositionFloatedBar(x);
}
else
{
mpLayout->SetBarState(x, 0, TRUE);
//mpLayout->RecalcLayout(true);
//mpLayout->RepositionFloatedBar(x);
}
// // // x->mState = wxCBAR_FLOATING;
// // // mpLayout->ApplyBarProperties(x);
}
else
{
wxBell();
}
break;
}
}
i++;
}
void MyFrame::OnButt2( wxCommandEvent& event )
{
static int i =0;
// cbBarInfo* FindBarByName( const wxString& name );
switch(i % 2) {
case 0:
{
cbBarInfo* x = mpLayout->FindBarByName(wxString("Bar-1"));
if(x)
{
for(int a=0;a<MAX_BAR_STATES;a++)
{
x->mDimInfo.mSizes[a].x = 200;
x->mDimInfo.mSizes[a].y = 200;
}
x->mpBarWnd->SetSize(200,200);
mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE); // HACK !!!
mpLayout->SetBarState(x, 0, TRUE); // HACK !!!
wxYield(); // HACK !!! needed to resize BEFORE redraw
mpLayout->RefreshNow( TRUE ); // HACK !!! needed to trigger redraw
}
else
{
wxBell();
}
break;
}
case 1:
{
cbBarInfo* x = mpLayout->FindBarByName(wxString("Bar-1"));
if(x)
{
//mpLayout->InverseVisibility(x);
for(int a=0;a<MAX_BAR_STATES;a++)
{
// see cbPaneDrawPlugin::OnSizeBarWindow( cbSizeBarWndEvent& event )
x->mDimInfo.mSizes[a].x = 10 + 2 + 2*x->mDimInfo.mHorizGap;
x->mDimInfo.mSizes[a].y = 10 + 2 + 2*x->mDimInfo.mVertGap;
}
x->mpBarWnd->SetSize(10,10);
mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE); // HACK !!!
mpLayout->SetBarState(x, 0, TRUE); // HACK !!!
wxYield(); // HACK !!! needed to resize BEFORE redraw
mpLayout->RefreshNow( TRUE ); // HACK !!! needed to trigger redraw
// // mpLayout->SetBarState(x, wxCBAR_FLOATING, TRUE);
// // mpLayout->RecalcLayout(true);
// // // mpLayout->RepositionFloatedBar(x);
// // mpLayout->RecalcLayout(true);
// // mpLayout->RepositionFloatedBar(x);
// // mpLayout->SetBarState(x, 0, TRUE);
// // wxYield();
// // mpLayout->RefreshNow( TRUE );
// // mpLayout->RecalcLayout(true);
}
else
{
wxBell();
}
break;
}
}
i++;
}

View File

@@ -0,0 +1,3 @@
/* mondrian ICON "mondrian.ico" */
#include "wx/msw/wx.rc"

View File

@@ -0,0 +1,23 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds sample for 32-bit BC++
WXDIR = ..\..\..\..
TARGET = fl_sample3
EXTRACPPFLAGS =-DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WSLIBDIR)\fl.lib
!else
EXTRALIBS = $(WSLIBDIR)\fld.lib
!endif
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32

View File

@@ -0,0 +1,18 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile for wxWorkshop for mingw & cygwin.
WXDIR = ../../../..
TARGET = fl_sample3
EXTRACPPFLAGS = -DBMP_DIR=\"../bitmaps/\"
EXTRALIBS = $(WXDIR)/lib/libfl.a
OBJECTS = $(TARGET).o
include $(WXDIR)/src/makeprog.g95

View File

@@ -0,0 +1,24 @@
#
# File: Makefile
# Author: Hans Van Leemputten
# Created: 2001
# Updated:
# Copyright: (c) wxWorkshop team, 2001
#
# Makefile : Builds fl sample (VC++, WIN32)
# Use FINAL=1 argument to nmake to build final version with no debug info.
WXDIR = ..\..\..\..
TARGET = fl_sample3
EXTRAINC = -DBMP_DIR=\"../bitmaps/\"
!if "$(FINAL)" == "1"
EXTRALIBS = $(WXDIR)\lib\fl.lib
!else
EXTRALIBS = $(WXDIR)\lib\fld.lib
!endif
PROGRAM = $(TARGET)
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.vc