now MSW stuff is complete

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1998-05-20 14:21:00 +00:00
parent 2bda0e1738
commit bbf1f0e5cf
118 changed files with 9265 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
#
# File: makefile.bcc
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds tab example
# WXWIN and BCCDIR are set by parent make
WXDIR = $(WXWIN)
!include $(WXDIR)\src\makeb32.env
WXLIBDIR = $(WXDIR)\lib
WXINC = $(WXDIR)\include\msw
WXLIB = $(WXLIBDIR)\wx32.lib
LIBS=$(WXLIB) cw32 import32 ole2w32
TARGET=tbtest
!if "$(FINAL)" == "0"
LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
OPT = -Od
DEBUG_FLAGS= -v
!else
LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
OPT = -Od
DEBUG_FLAGS =
!endif
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
OBJECTS = tbtest.obj
$(TARGET).exe: $(OBJECTS) $(TARGET).def $(TARGET).res
tlink32 $(LINKFLAGS) @&&!
c0w32.obj $(OBJECTS)
$(TARGET)
nul
$(LIBS)
$(TARGET).def
!
brc32 -K $(TARGET).res
.$(SRCSUFF).obj:
bcc32 $(CPPFLAGS) -c {$< }
.c.obj:
bcc32 $(CPPFLAGS) -P- -c {$< }
tbtest.obj: tbtest.$(SRCSUFF)
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET)
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.rws

View File

@@ -0,0 +1,73 @@
#
# File: makefile.bcc
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds tbtest example (DOS).
!if "$(BCCDIR)" == ""
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
!endif
!if "$(WXWIN)" == ""
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
!endif
WXDIR = $(WXWIN)
!include $(WXDIR)\src\makebcc.env
THISDIR = $(WXDIR)\samples\taskbar
WXLIB = $(WXDIR)\lib\wx.lib
LIBS=$(WXLIB) mathwl cwl import
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
CFG=$(WXDIR)\src\wxwin.cfg
!ifndef FINAL
FINAL=0
!endif
!if "$(FINAL)" == "0"
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
OPT = -Od
DEBUG_FLAGS= -v
!else
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
OPT = -O2
DEBUG_FLAGS=
!endif
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
OBJECTS = tbtest.obj
tbtest: tbtest.exe
all: tbtest.exe
tbtest.exe: $(WXLIB) tbtest.obj tbtest.def tbtest.res
tlink $(LINKFLAGS) @&&!
c0wl.obj tbtest.obj
tbtest
nul
$(LIBS)
tbtest.def
!
rc -31 -K tbtest.res
.$(SRCSUFF).obj:
bcc $(CPPFLAGS) -c {$< }
tbtest.obj: tbtest.$(SRCSUFF)
tbtest.res : tbtest.rc $(WXDIR)\include\msw\wx.rc
rc -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa tbtest
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.rws

View File

@@ -0,0 +1,65 @@
#
# File: makefile.dos
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds taskbar example (DOS).
# Use FINAL=1 argument to nmake to build final version with no debugging
# info
WXDIR = $(WXWIN)
!include $(WXDIR)\src\makemsc.env
THISDIR = $(WXDIR)\samples\taskbar
!ifndef FINAL
FINAL=0
!endif
HEADERS =
SOURCES = tbtest.$(SRCSUFF)
OBJECTS = tbtest.obj
all: tbtest.exe
wx:
cd $(WXDIR)\src\msw
nmake -f makefile.dos FINAL=$(FINAL)
cd $(THISDIR)
wxclean:
cd $(WXDIR)\src\msw
nmake -f makefile.dos clean
cd $(THISDIR)
tbtest.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) tbtest.obj tbtest.def tbtest.res
link $(LINKFLAGS) @<<
tbtest.obj $(WXDIR)\src\msw\dummy.obj,
tbtest,
NUL,
$(LIBS),
tbtest.def
;
<<
rc -K tbtest.res
tbtest.obj: tbtest.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<
tbtest.res : tbtest.rc $(WXDIR)\include\wx\msw\wx.rc
rc -r /i$(WXDIR)\include tbtest
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.sbr
-erase *.pdb

View File

@@ -0,0 +1,37 @@
#
# File: makefile.unx
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile for taskbar example
WXDIR = ../..
# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/makeg95.env
OBJECTS = $(OBJDIR)/tbtest.$(OBJSUFF) $(OBJDIR)/tbtest_resources.$(OBJSUFF)
all: $(OBJDIR) tbtest$(GUISUFFIX)$(EXESUFF)
wx:
$(OBJDIR):
mkdir $(OBJDIR)
tbtest$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB)
$(CC) $(LDFLAGS) -o tbtest$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
$(OBJDIR)/tbtest.$(OBJSUFF): tbtest.$(SRCSUFF)
$(CC) -c $(CPPFLAGS) -o $@ tbtest.$(SRCSUFF)
$(OBJDIR)/tbtest_resources.o: tbtest.rc
$(RESCOMP) -i tbtest.rc -o $(OBJDIR)/tbtest_resources.o $(RESFLAGS)
clean:
rm -f $(OBJECTS) tbtest$(GUISUFFIX).exe core *.rsc *.res

View File

@@ -0,0 +1,64 @@
#
# File: makefile.nt
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds tab example (MS VC++).
# Use FINAL=1 argument to nmake to build final version with no debugging
# info
# Set WXDIR for your system
WXDIR = $(WXWIN)
WXUSINGDLL=0
!include $(WXDIR)\src\ntwxwin.mak
THISDIR = $(WXDIR)\samples\taskbar
PROGRAM=tbtest
OBJECTS = $(PROGRAM).obj
$(PROGRAM): $(PROGRAM).exe
all: wx $(PROGRAM).exe
wx:
cd $(WXDIR)\src\msw
nmake -f makefile.nt FINAL=$(FINAL)
cd $(THISDIR)
wxclean:
cd $(WXDIR)\src\msw
nmake -f makefile.nt clean
cd $(THISDIR)
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
$(link) @<<
-out:$(PROGRAM).exe
$(LINKFLAGS)
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
$(LIBS)
<<
$(PROGRAM).obj: $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
$(cc) @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.sbr
-erase *.pdb

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

120
samples/taskbar/tbtest.cpp Normal file
View File

@@ -0,0 +1,120 @@
/////////////////////////////////////////////////////////////////////////////
// Name: tbtest.cpp
// Purpose: wxTaskBarIcon demo
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx.h"
#endif
#include "wx/msw/taskbar.h"
#include "tbtest.h"
// Declare two frames
MyDialog *dialog = NULL;
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void)
{
wxIcon icon("mondrian_icon");
if (!m_taskBarIcon.SetIcon(icon, "wxTaskBarIcon Sample"))
wxMessageBox("Could not set icon.");
// Create the main frame window
dialog = new MyDialog(NULL, -1, "wxTaskBarIcon Test Dialog", wxPoint(-1, -1), wxSize(365, 290), wxDIALOG_MODELESS|wxDEFAULT_DIALOG_STYLE);
dialog->Show(TRUE);
return TRUE;
}
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
EVT_BUTTON(wxID_OK, MyDialog::OnOK)
EVT_BUTTON(wxID_EXIT, MyDialog::OnExit)
END_EVENT_TABLE()
MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, const long windowStyle):
wxDialog(parent, id, title, pos, size, windowStyle)
{
Init();
}
void MyDialog::OnOK(wxCommandEvent& event)
{
Show(FALSE);
}
void MyDialog::OnExit(wxCommandEvent& event)
{
Close(TRUE);
}
void MyDialog::OnCloseWindow(wxCloseEvent& event)
{
Destroy();
}
void MyDialog::Init(void)
{
int dialogWidth = 365;
int dialogHeight = 290;
wxStaticText* stat = new wxStaticText(this, -1, "Press OK to hide me, Exit to quit.",
wxPoint(10, 20));
wxStaticText* stat2 = new wxStaticText(this, -1, "Double-click on the taskbar icon to show me again.",
wxPoint(10, 40));
wxButton *okButton = new wxButton(this, wxID_OK, "OK", wxPoint(100, 230), wxSize(80, 25));
wxButton *exitButton = new wxButton(this, wxID_EXIT, "Exit", wxPoint(185, 230), wxSize(80, 25));
okButton->SetDefault();
this->Centre(wxBOTH);
}
// Overridables
void MyTaskBarIcon::OnMouseMove(void)
{
}
void MyTaskBarIcon::OnLButtonDown(void)
{
}
void MyTaskBarIcon::OnLButtonUp(void)
{
}
void MyTaskBarIcon::OnRButtonDown(void)
{
}
void MyTaskBarIcon::OnRButtonUp(void)
{
}
void MyTaskBarIcon::OnLButtonDClick(void)
{
dialog->Show(TRUE);
}
void MyTaskBarIcon::OnRButtonDClick(void)
{
}

View File

@@ -0,0 +1,8 @@
NAME TBTest
DESCRIPTION 'wxTaskBarIcon test'
EXETYPE WINDOWS
STUB 'WINSTUB.EXE'
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE MULTIPLE
HEAPSIZE 1024
STACKSIZE 16192

50
samples/taskbar/tbtest.h Normal file
View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: tbtest.h
// Purpose: wxTaskBarIcon sample
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
class MyTaskBarIcon: public wxTaskBarIcon
{
public:
MyTaskBarIcon() {};
virtual void OnMouseMove(void);
virtual void OnLButtonDown(void);
virtual void OnLButtonUp(void);
virtual void OnRButtonDown(void);
virtual void OnRButtonUp(void);
virtual void OnLButtonDClick(void);
virtual void OnRButtonDClick(void);
};
// Define a new application
class MyApp: public wxApp
{
public:
bool OnInit(void);
protected:
MyTaskBarIcon m_taskBarIcon;
};
class MyDialog: public wxDialog
{
public:
MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, const long windowStyle = wxDEFAULT_DIALOG_STYLE);
void OnOK(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent& event);
void Init(void);
DECLARE_EVENT_TABLE()
};

View File

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