1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-02-02 15:07:36 -05:00

Remove ResizableDialog logic from the UI due to possible license conflicts..

svn path=/icecast/trunk/icecast/; revision=8066
This commit is contained in:
oddsock 2004-10-22 15:41:47 +00:00
parent ead216d40a
commit 02471ae68d
12 changed files with 447 additions and 1057 deletions

View File

@ -66,7 +66,7 @@ BOOL CConfigTab::OnInitDialog()
CTabPageSSL::OnInitDialog(); CTabPageSSL::OnInitDialog();
// TODO: Add extra initialization here // TODO: Add extra initialization here
AddAnchor(IDC_CONFIG, TOP_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_CONFIG, TOP_LEFT, BOTTOM_RIGHT);
return TRUE; // return TRUE unless you set the focus to a control return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE // EXCEPTION: OCX Property Pages should return FALSE

View File

@ -1,31 +1,31 @@
; CLW file contains information for the MFC ClassWizard ; CLW file contains information for the MFC ClassWizard
[General Info] [General Info]
Version=1 Version=1
LastClass=CStatus LastClass=CStatus
LastTemplate=CDialog LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h" NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "Icecast2win.h" NewFileInclude2=#include "Icecast2win.h"
ClassCount=6 ClassCount=6
Class1=CIcecast2winApp Class1=CIcecast2winApp
Class2=CIcecast2winDlg Class2=CIcecast2winDlg
Class3=CAboutDlg Class3=CAboutDlg
ResourceCount=10 ResourceCount=10
Resource1=IDD_SSTATUS Resource1=IDD_SSTATUS
Resource2=IDR_MAINFRAME Resource2=IDR_MAINFRAME
Resource3=IDD_ABOUTBOX Resource3=IDD_STATSDIALOG
Resource4=IDR_MENU2 Resource4=IDR_MENU2
Class4=CStatus Class4=CStatus
Resource5=IDR_TRAY Resource5=IDR_TRAY
Class5=CConfigTab Class5=CConfigTab
Class6=CStatsTab Class6=CStatsTab
Resource6=IDR_MENU4 Resource6=IDR_MENU4
Resource7=IDD_ICECAST2WIN_DIALOG Resource7=IDD_ICECAST2WIN_DIALOG
Resource8=IDD_CONFIGDIALOG Resource8=IDD_CONFIGDIALOG
Resource9=IDR_MENU3 Resource9=IDR_MENU3
Resource10=IDD_STATSDIALOG Resource10=IDD_ABOUTBOX
[CLS:CIcecast2winApp] [CLS:CIcecast2winApp]
Type=0 Type=0
@ -48,37 +48,37 @@ HeaderFile=Icecast2winDlg.h
ImplementationFile=Icecast2winDlg.cpp ImplementationFile=Icecast2winDlg.cpp
Filter=D Filter=D
[DLG:IDD_ABOUTBOX] [DLG:IDD_ABOUTBOX]
Type=1 Type=1
Class=CAboutDlg Class=CAboutDlg
ControlCount=3 ControlCount=3
Control1=IDC_STATIC,static,1342177283 Control1=IDC_STATIC,static,1342177283
Control2=IDC_STATIC,static,1342308480 Control2=IDC_STATIC,static,1342308480
Control3=IDOK,button,1342373889 Control3=IDOK,button,1342373889
[DLG:IDD_ICECAST2WIN_DIALOG] [DLG:IDD_ICECAST2WIN_DIALOG]
Type=1 Type=1
Class=CIcecast2winDlg Class=CIcecast2winDlg
ControlCount=8 ControlCount=8
Control1=IDC_MAINTAB,SysTabControl32,1342177280 Control1=IDC_MAINTAB,SysTabControl32,1342177280
Control2=IDC_START,button,1342242816 Control2=IDC_START,button,1342242816
Control3=IDC_AUTOSTART,button,1342251011 Control3=IDC_AUTOSTART,button,1342251011
Control4=IDC_STATIC,static,1342177294 Control4=IDC_STATIC,static,1342177294
Control5=IDC_SERVERSTATUS,static,1342177294 Control5=IDC_SERVERSTATUS,static,1342177294
Control6=IDC_STATIC_SS,static,1342308865 Control6=IDC_STATIC_SS,static,1342308865
Control7=IDC_STATICBLACK,static,1342177294 Control7=IDC_STATICBLACK,static,1342177294
Control8=IDC_HIDESYSTRAY,button,1342242816 Control8=IDC_HIDESYSTRAY,button,1342242816
[DLG:IDD_SSTATUS] [DLG:IDD_SSTATUS]
Type=1 Type=1
Class=CStatus Class=CStatus
ControlCount=5 ControlCount=5
Control1=IDC_FILLER2,static,1342308352 Control1=IDC_FILLER2,static,1342308352
Control2=IDC_GLOBALSTAT_LIST,SysListView32,1350631425 Control2=IDC_GLOBALSTAT_LIST,SysListView32,1350631425
Control3=IDC_STATIC_GS,static,1342308353 Control3=IDC_STATIC_GS,static,1342308353
Control4=IDC_STATIC_RUN,static,1342308352 Control4=IDC_STATIC_RUN,static,1342308352
Control5=IDC_RUNNINGFOR,static,1342308352 Control5=IDC_RUNNINGFOR,static,1342308352
[CLS:CStatus] [CLS:CStatus]
Type=0 Type=0
HeaderFile=Status.h HeaderFile=Status.h
@ -88,12 +88,12 @@ Filter=D
LastObject=ID_POPUP_ADDTOGLOBALSTATLIST LastObject=ID_POPUP_ADDTOGLOBALSTATLIST
VirtualFilter=dWC VirtualFilter=dWC
[DLG:IDD_CONFIGDIALOG] [DLG:IDD_CONFIGDIALOG]
Type=1 Type=1
Class=CConfigTab Class=CConfigTab
ControlCount=1 ControlCount=1
Control1=IDC_CONFIG,edit,1352732868 Control1=IDC_CONFIG,edit,1352732868
[CLS:CConfigTab] [CLS:CConfigTab]
Type=0 Type=0
HeaderFile=ConfigTab.h HeaderFile=ConfigTab.h
@ -103,16 +103,16 @@ Filter=D
VirtualFilter=dWC VirtualFilter=dWC
LastObject=IDC_CONFIG LastObject=IDC_CONFIG
[DLG:IDD_STATSDIALOG] [DLG:IDD_STATSDIALOG]
Type=1 Type=1
Class=CStatsTab Class=CStatsTab
ControlCount=5 ControlCount=5
Control1=IDC_STATSLIST,SysListView32,1350631425 Control1=IDC_STATSLIST,SysListView32,1350631425
Control2=IDC_SOURCELIST,SysListView32,1350631425 Control2=IDC_SOURCELIST,SysListView32,1350631425
Control3=IDC_FILLER1,static,1342308352 Control3=IDC_FILLER1,static,1342308352
Control4=IDC_STATIC_SLS,static,1342308353 Control4=IDC_STATIC_SLS,static,1342308353
Control5=IDC_STATIC,static,1342308352 Control5=IDC_STATIC,static,1342308352
[CLS:CStatsTab] [CLS:CStatsTab]
Type=0 Type=0
HeaderFile=StatsTab.h HeaderFile=StatsTab.h
@ -122,31 +122,31 @@ Filter=D
VirtualFilter=dWC VirtualFilter=dWC
LastObject=IDC_SOURCELIST LastObject=IDC_SOURCELIST
[MNU:IDR_MENU2] [MNU:IDR_MENU2]
Type=1 Type=1
Class=? Class=?
Command1=ID_POPUP_ADDTOGLOBALSTATLIST Command1=ID_POPUP_ADDTOGLOBALSTATLIST
CommandCount=1 CommandCount=1
[MNU:IDR_MENU3] [MNU:IDR_MENU3]
Type=1 Type=1
Class=? Class=?
Command1=ID__DELETEFROMGLOBALSTATS Command1=ID__DELETEFROMGLOBALSTATS
Command2=ID__MAKETHISSTATTHEWINDOWTITLE Command2=ID__MAKETHISSTATTHEWINDOWTITLE
CommandCount=2 CommandCount=2
[MNU:IDR_TRAY] [MNU:IDR_TRAY]
Type=1 Type=1
Class=CIcecast2winDlg Class=CIcecast2winDlg
Command1=ID_BLANK_RESTORE Command1=ID_BLANK_RESTORE
CommandCount=1 CommandCount=1
[MNU:IDR_MENU4] [MNU:IDR_MENU4]
Type=1 Type=1
Class=CIcecast2winDlg Class=CIcecast2winDlg
Command1=ID_FILE_EXIT Command1=ID_FILE_EXIT
Command2=ID_FILE_EDITCONFIGURATION Command2=ID_FILE_EDITCONFIGURATION
Command3=ID_ABOUT_HELP Command3=ID_ABOUT_HELP
Command4=ID_ABOUT_CREDITS Command4=ID_ABOUT_CREDITS
CommandCount=4 CommandCount=4

View File

@ -1,301 +1,299 @@
//Microsoft Developer Studio generated resource script. //Microsoft Developer Studio generated resource script.
// //
#include "resource.h" #include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "afxres.h" #include "afxres.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources // English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32 #ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252) #pragma code_page(1252)
#endif //_WIN32 #endif //_WIN32
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// TEXTINCLUDE // TEXTINCLUDE
// //
1 TEXTINCLUDE DISCARDABLE 1 TEXTINCLUDE DISCARDABLE
BEGIN BEGIN
"resource.h\0" "resource.h\0"
END END
2 TEXTINCLUDE DISCARDABLE 2 TEXTINCLUDE DISCARDABLE
BEGIN BEGIN
"#include ""afxres.h""\r\n" "#include ""afxres.h""\r\n"
"\0" "\0"
END END
3 TEXTINCLUDE DISCARDABLE 3 TEXTINCLUDE DISCARDABLE
BEGIN BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n" "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n" "#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n" "#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n" "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n" "\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n" "#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n" "LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n" "#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n" "#endif //_WIN32\r\n"
"#include ""res\\Icecast2win.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""res\\Icecast2win.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n" "#include ""afxres.rc"" // Standard components\r\n"
"#endif\r\n" "#endif\r\n"
"\0" "\0"
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Dialog // Dialog
// //
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Icecast2win" CAPTION "About Icecast2win"
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "Icecast 2 Win32",IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Icecast 2 Win32",IDC_STATIC,40,10,119,8,SS_NOPREFIX
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END END
IDD_ICECAST2WIN_DIALOG DIALOGEX 0, 0, 318, 249 IDD_ICECAST2WIN_DIALOG DIALOGEX 0, 0, 326, 259
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU | WS_THICKFRAME WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "icecast2" MENU IDR_MENU4
MENU IDR_MENU4 FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif" BEGIN
BEGIN CONTROL "Tab1",IDC_MAINTAB,"SysTabControl32",0x0,0,49,326,210
CONTROL "Tab1",IDC_MAINTAB,"SysTabControl32",0x0,0,48,318,201 PUSHBUTTON "Start Server",IDC_START,17,31,56,14
PUSHBUTTON "Start Server",IDC_START,17,31,56,14 CONTROL "Start Server on Application Startup",IDC_AUTOSTART,
CONTROL "Start Server on Application Startup",IDC_AUTOSTART, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,76,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,76, 29,81,17
29,81,17 CONTROL 159,IDC_STATIC,"Static",SS_BITMAP,0,0,117,20
CONTROL 159,IDC_STATIC,"Static",SS_BITMAP,0,0,117,20 CONTROL 151,IDC_SERVERSTATUS,"Static",SS_BITMAP,173,32,65,18,
CONTROL 151,IDC_SERVERSTATUS,"Static",SS_BITMAP,173,32,65,18, WS_EX_CLIENTEDGE
WS_EX_CLIENTEDGE CTEXT "Server Status",IDC_STATIC_SS,172,23,65,10,
CTEXT "Server Status",IDC_STATIC_SS,172,23,65,10, SS_CENTERIMAGE
SS_CENTERIMAGE CONTROL 150,IDC_STATICBLACK,"Static",SS_BITMAP,116,0,214,20
CONTROL 150,IDC_STATICBLACK,"Static",SS_BITMAP,116,0,200,20 PUSHBUTTON "Hide To Systray",IDC_HIDESYSTRAY,262,22,58,12
PUSHBUTTON "Hide To Systray",IDC_HIDESYSTRAY,257,22,58,12 END
END
IDD_SSTATUS DIALOG DISCARDABLE 0, 0, 320, 210
IDD_SSTATUS DIALOG DISCARDABLE 0, 0, 320, 210 STYLE WS_CHILD
STYLE WS_CHILD FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif" BEGIN
BEGIN LTEXT "",IDC_FILLER2,0,199,319,11
LTEXT "",IDC_FILLER2,0,199,319,11 CONTROL "List1",IDC_GLOBALSTAT_LIST,"SysListView32",LVS_REPORT |
CONTROL "List1",IDC_GLOBALSTAT_LIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,9,34,300,147
WS_BORDER | WS_TABSTOP,9,34,300,147 LTEXT "Global Statistics",IDC_STATIC_GS,9,6,300,10
CTEXT "Global Statistics",IDC_STATIC_GS,9,6,300,10 LTEXT "Server Has Been Running For ",IDC_STATIC_RUN,10,19,109,
LTEXT "Server Has Been Running For ",IDC_STATIC_RUN,46,184,100, 8
8 LTEXT "",IDC_RUNNINGFOR,121,19,156,8
LTEXT "",IDC_RUNNINGFOR,149,184,156,8 END
END
IDD_CONFIGDIALOG DIALOG DISCARDABLE 0, 0, 320, 210
IDD_CONFIGDIALOG DIALOG DISCARDABLE 0, 0, 320, 210 STYLE WS_CHILD
STYLE WS_CHILD FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif" BEGIN
BEGIN EDITTEXT IDC_CONFIG,0,0,320,210,ES_MULTILINE | ES_AUTOVSCROLL |
EDITTEXT IDC_CONFIG,0,0,320,210,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL
ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL END
END
IDD_STATSDIALOG DIALOG DISCARDABLE 0, 0, 320, 210
IDD_STATSDIALOG DIALOG DISCARDABLE 0, 0, 320, 210 STYLE WS_CHILD
STYLE WS_CHILD FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif" BEGIN
BEGIN CONTROL "List1",IDC_STATSLIST,"SysListView32",LVS_REPORT |
CONTROL "List1",IDC_STATSLIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,142,34,163,147
WS_BORDER | WS_TABSTOP,142,34,149,160 CONTROL "List2",IDC_SOURCELIST,"SysListView32",LVS_REPORT |
CONTROL "List2",IDC_SOURCELIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,9,34,111,147
WS_BORDER | WS_TABSTOP,9,34,111,159 LTEXT "Source Level Statistics",IDC_STATIC_SLS,9,7,300,10
LTEXT "",IDC_FILLER1,0,199,320,11 LTEXT "Click source to view statistics",IDC_STATIC,18,25,111,8
CTEXT "Source Level Statistics",IDC_STATIC_SLS,9,7,300,10 END
LTEXT "Click source to view statistics",IDC_STATIC,18,25,111,8
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
#ifndef _MAC //
///////////////////////////////////////////////////////////////////////////// // Version
// //
// Version
// VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
VS_VERSION_INFO VERSIONINFO PRODUCTVERSION 1,0,0,1
FILEVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL
PRODUCTVERSION 1,0,0,1 #ifdef _DEBUG
FILEFLAGSMASK 0x3fL FILEFLAGS 0x1L
#ifdef _DEBUG #else
FILEFLAGS 0x1L FILEFLAGS 0x0L
#else #endif
FILEFLAGS 0x0L FILEOS 0x4L
#endif FILETYPE 0x1L
FILEOS 0x4L FILESUBTYPE 0x0L
FILETYPE 0x1L BEGIN
FILESUBTYPE 0x0L BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "040904B0"
BEGIN BEGIN
BLOCK "040904B0" VALUE "CompanyName", "\0"
BEGIN VALUE "FileDescription", "Icecast2win MFC Application\0"
VALUE "CompanyName", "\0" VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "FileDescription", "Icecast2win MFC Application\0" VALUE "InternalName", "Icecast2win\0"
VALUE "FileVersion", "1, 0, 0, 1\0" VALUE "LegalCopyright", "Copyright (C) 2001\0"
VALUE "InternalName", "Icecast2win\0" VALUE "LegalTrademarks", "\0"
VALUE "LegalCopyright", "Copyright (C) 2001\0" VALUE "OriginalFilename", "Icecast2win.EXE\0"
VALUE "LegalTrademarks", "\0" VALUE "ProductName", "Icecast2win Application\0"
VALUE "OriginalFilename", "Icecast2win.EXE\0" VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "ProductName", "Icecast2win Application\0" END
VALUE "ProductVersion", "1, 0, 0, 1\0" END
END BLOCK "VarFileInfo"
END BEGIN
BLOCK "VarFileInfo" VALUE "Translation", 0x409, 1200
BEGIN END
VALUE "Translation", 0x409, 1200 END
END
END #endif // !_MAC
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////// // DESIGNINFO
// //
// DESIGNINFO
// #ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
#ifdef APSTUDIO_INVOKED BEGIN
GUIDELINES DESIGNINFO DISCARDABLE IDD_ABOUTBOX, DIALOG
BEGIN BEGIN
IDD_ABOUTBOX, DIALOG LEFTMARGIN, 7
BEGIN RIGHTMARGIN, 228
LEFTMARGIN, 7 TOPMARGIN, 7
RIGHTMARGIN, 228 BOTTOMMARGIN, 48
TOPMARGIN, 7 END
BOTTOMMARGIN, 48 END
END #endif // APSTUDIO_INVOKED
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////// // Bitmap
// //
// Bitmap
// IDB_BITMAP4 BITMAP DISCARDABLE "black.bmp"
IDB_BITMAP5 BITMAP DISCARDABLE "stopped.bmp"
IDB_BITMAP4 BITMAP DISCARDABLE "black.bmp" IDB_BITMAP6 BITMAP DISCARDABLE "running.bmp"
IDB_BITMAP5 BITMAP DISCARDABLE "stopped.bmp" IDB_BITMAP7 BITMAP DISCARDABLE "icecast2logo2.bmp"
IDB_BITMAP6 BITMAP DISCARDABLE "running.bmp"
IDB_BITMAP7 BITMAP DISCARDABLE "icecast2logo2.bmp" /////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////// // Icon
// //
// Icon
// // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
// Icon with lowest ID value placed first to ensure application icon IDR_MAINFRAME ICON DISCARDABLE "icecast.ico"
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "icecast.ico" /////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////// // Menu
// //
// Menu
// IDR_MENU2 MENU DISCARDABLE
BEGIN
IDR_MENU2 MENU DISCARDABLE POPUP "Popup"
BEGIN BEGIN
POPUP "Popup" MENUITEM "Add To Global Stat List", ID_POPUP_ADDTOGLOBALSTATLIST
BEGIN END
MENUITEM "Add To Global Stat List", ID_POPUP_ADDTOGLOBALSTATLIST END
END
END IDR_MENU3 MENU DISCARDABLE
BEGIN
IDR_MENU3 MENU DISCARDABLE POPUP " "
BEGIN BEGIN
POPUP " " MENUITEM "Delete From Global Stats", ID__DELETEFROMGLOBALSTATS
BEGIN MENUITEM "Make this stat the window title",
MENUITEM "Delete From Global Stats", ID__DELETEFROMGLOBALSTATS ID__MAKETHISSTATTHEWINDOWTITLE
MENUITEM "Make this stat the window title",
ID__MAKETHISSTATTHEWINDOWTITLE END
END
END
END IDR_TRAY MENU DISCARDABLE
BEGIN
IDR_TRAY MENU DISCARDABLE POPUP "Blank"
BEGIN BEGIN
POPUP "Blank" MENUITEM "Restore", ID_BLANK_RESTORE
BEGIN END
MENUITEM "Restore", ID_BLANK_RESTORE END
END
END IDR_MENU4 MENU DISCARDABLE
BEGIN
IDR_MENU4 MENU DISCARDABLE POPUP "&File"
BEGIN BEGIN
POPUP "&File" MENUITEM "E&xit", ID_FILE_EXIT
BEGIN END
MENUITEM "E&xit", ID_FILE_EXIT POPUP "C&onfiguration"
END BEGIN
POPUP "C&onfiguration" MENUITEM "&Edit Configuration", ID_FILE_EDITCONFIGURATION
BEGIN END
MENUITEM "&Edit Configuration", ID_FILE_EDITCONFIGURATION POPUP "&About"
END BEGIN
POPUP "&About" MENUITEM "H&elp", ID_ABOUT_HELP
BEGIN MENUITEM "Cr&edits", ID_ABOUT_CREDITS
MENUITEM "H&elp", ID_ABOUT_HELP END
MENUITEM "Cr&edits", ID_ABOUT_CREDITS END
END
END
/////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////// // String Table
// //
// String Table
// STRINGTABLE DISCARDABLE
BEGIN
STRINGTABLE DISCARDABLE IDS_ABOUTBOX "&About Icecast2win..."
BEGIN END
IDS_ABOUTBOX "&About Icecast2win..."
END #endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED //
///////////////////////////////////////////////////////////////////////////// // Generated from the TEXTINCLUDE 3 resource.
// //
// Generated from the TEXTINCLUDE 3 resource. #define _AFX_NO_SPLITTER_RESOURCES
// #define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_SPLITTER_RESOURCES #define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_OLE_RESOURCES #define _AFX_NO_PROPERTY_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE 9, 1
#ifdef _WIN32 #pragma code_page(1252)
LANGUAGE 9, 1 #endif //_WIN32
#pragma code_page(1252) #include "res\Icecast2win.rc2" // non-Microsoft Visual C++ edited resources
#endif //_WIN32 #include "afxres.rc" // Standard components
#include "res\Icecast2win.rc2" // non-Microsoft Visual C++ edited resources #endif
#include "afxres.rc" // Standard components
#endif /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -5,7 +5,6 @@
#include "Icecast2win.h" #include "Icecast2win.h"
#include "Icecast2winDlg.h" #include "Icecast2winDlg.h"
#include <process.h> #include <process.h>
#include "ResizableDialog.h"
#include <libxml/xmlmemory.h> #include <libxml/xmlmemory.h>
#include <libxml/parser.h> #include <libxml/parser.h>
@ -24,8 +23,7 @@ extern "C" {
#include "client.h" #include "client.h"
#include "stats.h" #include "stats.h"
} }
#include <afxinet.h> #include <afxinet.h>
#ifdef _DEBUG #ifdef _DEBUG
@ -165,7 +163,7 @@ void RemoveFromAdditionalGlobalStats(CString source, CString name) {
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About // CAboutDlg dialog used for App About
class CAboutDlg : public CResizableDialog class CAboutDlg : public CDialog
{ {
public: public:
CAboutDlg(); CAboutDlg();
@ -188,7 +186,7 @@ protected:
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
}; };
CAboutDlg::CAboutDlg() : CResizableDialog(CAboutDlg::IDD) CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{ {
//{{AFX_DATA_INIT(CAboutDlg) //{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT //}}AFX_DATA_INIT
@ -196,12 +194,12 @@ CAboutDlg::CAboutDlg() : CResizableDialog(CAboutDlg::IDD)
void CAboutDlg::DoDataExchange(CDataExchange* pDX) void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{ {
CResizableDialog::DoDataExchange(pDX); CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg) //{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP //}}AFX_DATA_MAP
} }
BEGIN_MESSAGE_MAP(CAboutDlg, CResizableDialog) BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg) //{{AFX_MSG_MAP(CAboutDlg)
// No message handlers // No message handlers
//}}AFX_MSG_MAP //}}AFX_MSG_MAP
@ -212,7 +210,7 @@ END_MESSAGE_MAP()
// CIcecast2winDlg dialog // CIcecast2winDlg dialog
CIcecast2winDlg::CIcecast2winDlg(CWnd* pParent /*=NULL*/) CIcecast2winDlg::CIcecast2winDlg(CWnd* pParent /*=NULL*/)
: CResizableDialog(CIcecast2winDlg::IDD, pParent) : CDialog(CIcecast2winDlg::IDD, pParent)
{ {
//{{AFX_DATA_INIT(CIcecast2winDlg) //{{AFX_DATA_INIT(CIcecast2winDlg)
m_AccessEdit = _T(""); m_AccessEdit = _T("");
@ -231,7 +229,7 @@ CIcecast2winDlg::CIcecast2winDlg(CWnd* pParent /*=NULL*/)
void CIcecast2winDlg::DoDataExchange(CDataExchange* pDX) void CIcecast2winDlg::DoDataExchange(CDataExchange* pDX)
{ {
CResizableDialog::DoDataExchange(pDX); CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CIcecast2winDlg) //{{AFX_DATA_MAP(CIcecast2winDlg)
DDX_Control(pDX, IDC_STATIC_SS, m_SS); DDX_Control(pDX, IDC_STATIC_SS, m_SS);
DDX_Control(pDX, IDC_SERVERSTATUS, m_ServerStatusBitmap); DDX_Control(pDX, IDC_SERVERSTATUS, m_ServerStatusBitmap);
@ -241,7 +239,7 @@ void CIcecast2winDlg::DoDataExchange(CDataExchange* pDX)
//}}AFX_DATA_MAP //}}AFX_DATA_MAP
} }
BEGIN_MESSAGE_MAP(CIcecast2winDlg, CResizableDialog) BEGIN_MESSAGE_MAP(CIcecast2winDlg, CDialog)
//{{AFX_MSG_MAP(CIcecast2winDlg) //{{AFX_MSG_MAP(CIcecast2winDlg)
ON_WM_SYSCOMMAND() ON_WM_SYSCOMMAND()
ON_WM_PAINT() ON_WM_PAINT()
@ -267,10 +265,11 @@ END_MESSAGE_MAP()
// CIcecast2winDlg message handlers // CIcecast2winDlg message handlers
#include "colors.h" #include "colors.h"
BOOL CIcecast2winDlg::OnInitDialog() BOOL CIcecast2winDlg::OnInitDialog()
{ {
CResizableDialog::OnInitDialog(); CDialog::OnInitDialog();
// Add "About..." menu item to system menu. // Add "About..." menu item to system menu.
@ -290,9 +289,8 @@ BOOL CIcecast2winDlg::OnInitDialog()
} }
} }
g_mainDialog = this; g_mainDialog = this;
// Set the icon for this dialog. The framework does this automatically // Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog // when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, TRUE); // Set big icon
@ -327,10 +325,10 @@ BOOL CIcecast2winDlg::OnInitDialog()
LoadConfig(); LoadConfig();
AddAnchor(IDC_MAINTAB, TOP_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_MAINTAB, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_STATICBLACK, TOP_LEFT, TOP_RIGHT); // AddAnchor(IDC_STATICBLACK, TOP_LEFT, TOP_RIGHT);
EnableSaveRestore("icecast2win", "positions"); // EnableSaveRestore("icecast2win", "positions");
m_pTray = NULL; m_pTray = NULL;
@ -354,7 +352,7 @@ void CIcecast2winDlg::OnSysCommand(UINT nID, LPARAM lParam)
} }
else else
{ {
CResizableDialog::OnSysCommand(nID, lParam); CDialog::OnSysCommand(nID, lParam);
} }
} }
@ -383,7 +381,7 @@ void CIcecast2winDlg::OnPaint()
} }
else else
{ {
CResizableDialog::OnPaint(); CDialog::OnPaint();
} }
} }
@ -636,7 +634,7 @@ void CIcecast2winDlg::OnTimer(UINT nIDEvent)
} }
} }
CResizableDialog::OnTimer(nIDEvent); CDialog::OnTimer(nIDEvent);
} }
char g_configFile[1024] = ""; char g_configFile[1024] = "";
@ -984,7 +982,7 @@ void CIcecast2winDlg::config_read()
char buf[1024] = ""; char buf[1024] = "";
CString tempString; CString tempString;
m_colSource0Width = GetPrivateProfileInt(gAppName, "col0SourceWidth", 150, gConfigFile); m_colSource0Width = GetPrivateProfileInt(gAppName, "col0SourceWidth", 163, gConfigFile);
m_colStats0Width = GetPrivateProfileInt(gAppName, "col0StatsWidth", 100, gConfigFile); m_colStats0Width = GetPrivateProfileInt(gAppName, "col0StatsWidth", 100, gConfigFile);
m_colStats1Width = GetPrivateProfileInt(gAppName, "col1StatsWidth", 150, gConfigFile); m_colStats1Width = GetPrivateProfileInt(gAppName, "col1StatsWidth", 150, gConfigFile);
m_colGStats0Width = GetPrivateProfileInt(gAppName, "col0GStatsWidth", 150, gConfigFile); m_colGStats0Width = GetPrivateProfileInt(gAppName, "col0GStatsWidth", 150, gConfigFile);
@ -1038,21 +1036,33 @@ void CIcecast2winDlg::OnClose()
{ {
// TODO: Add your message handler code here and/or call default // TODO: Add your message handler code here and/or call default
config_write(); config_write();
CResizableDialog::OnClose(); CDialog::OnClose();
} }
void CIcecast2winDlg::OnSize(UINT nType, int cx, int cy) void CIcecast2winDlg::OnSize(UINT nType, int cx, int cy)
{ {
CResizableDialog::OnSize(nType, cx, cy); CDialog::OnSize(nType, cx, cy);
int border1 = 0; int border1 = 0;
int border2 = 78; int border2 = 78;
// TODO: Add your message handler code here // TODO: Add your message handler code here
if (m_MainTab.m_hWnd) { if (m_MainTab.m_hWnd) {
CRect rect; CRect rect;
GetClientRect (&rect); GetClientRect (&rect);
m_MainTab.ResizeDialog(0, rect.Width()-border1, rect.Height()-border2); int x = rect.Width()-border1;
m_MainTab.ResizeDialog(1, rect.Width()-border1, rect.Height()-border2); int y = rect.Width()-border2;
statusTab.SetWindowPos(NULL, 4, 22, cx, cy, SWP_NOZORDER);
statsTab.SetWindowPos(NULL, 4, 22, cx, cy, SWP_NOZORDER);
statusTab.m_GlobalStatList.SetWindowPos(NULL, 14, 55, cx-40, cy-180, SWP_NOZORDER);
statsTab.m_StatsListCtrl.SetWindowPos(NULL, 213, 55, cx-243, cy-180, SWP_NOZORDER);
statsTab.m_SourceListCtrl.SetWindowPos(NULL, 14, 55, 166, cy-180, SWP_NOZORDER);
// CListCtrl m_StatsListCtrl;
// CListCtrl m_SourceListCtrl;
m_MainTab.SetWindowPos(NULL, 0, 80, cx, cy, SWP_NOZORDER);
//m_MainTab.ResizeDialog(0, rect.Width()-border1, rect.Height()-border2);
//m_MainTab.ResizeDialog(1, rect.Width()-border1, rect.Height()-border2);
} }
} }
@ -1123,7 +1133,7 @@ void CIcecast2winDlg::OnBlankRestore()
void CIcecast2winDlg::OnDestroy() void CIcecast2winDlg::OnDestroy()
{ {
CResizableDialog::OnDestroy(); CDialog::OnDestroy();
if (m_pTray) { if (m_pTray) {
delete m_pTray ; delete m_pTray ;

View File

@ -4,7 +4,6 @@
#if !defined(AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_) #if !defined(AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_)
#define AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_ #define AFX_ICECAST2WINDLG_H__23B4DA8B_C9BC_49C8_A62C_37FC6BC5E54A__INCLUDED_
#include "ResizableDialog.h"
#include "TabCtrlSSL.h" #include "TabCtrlSSL.h"
#include "TabPageSSL.h" #include "TabPageSSL.h"
@ -20,7 +19,7 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CIcecast2winDlg dialog // CIcecast2winDlg dialog
class CIcecast2winDlg : public CResizableDialog class CIcecast2winDlg : public CDialog
{ {
// Construction // Construction
public: public:

View File

@ -1,442 +0,0 @@
// ResizableDialog.cpp : implementation file
//
/////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000 by Paolo Messina
// (ppescher@yahoo.com)
//
// Free for non-commercial use.
// You may change the code to your needs,
// provided that credits to the original
// author is given in the modified files.
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ResizableDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResizableDialog
inline void CResizableDialog::Construct()
{
m_bInitDone = FALSE;
m_bUseMinTrack = TRUE;
m_bUseMaxTrack = FALSE;
m_bUseMaxRect = FALSE;
m_bShowGrip = TRUE;
m_bEnableSaveRestore = FALSE;
m_szGripSize.cx = GetSystemMetrics(SM_CXVSCROLL);
m_szGripSize.cy = GetSystemMetrics(SM_CYHSCROLL);
}
CResizableDialog::CResizableDialog()
{
Construct();
}
CResizableDialog::CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd)
: CDialog(nIDTemplate, pParentWnd)
{
Construct();
}
CResizableDialog::CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
: CDialog(lpszTemplateName, pParentWnd)
{
Construct();
}
CResizableDialog::~CResizableDialog()
{
// for safety
m_arrLayout.RemoveAll();
}
BEGIN_MESSAGE_MAP(CResizableDialog, CDialog)
//{{AFX_MSG_MAP(CResizableDialog)
ON_WM_NCHITTEST()
ON_WM_GETMINMAXINFO()
ON_WM_SIZE()
ON_WM_DESTROY()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResizableDialog message handlers
BOOL CResizableDialog::OnInitDialog()
{
CDialog::OnInitDialog();
UpdateGripPos();
// gets the template size as the min track size
CRect rc;
GetWindowRect(&rc);
m_ptMinTrackSize.x = rc.Width();
m_ptMinTrackSize.y = rc.Height();
m_bInitDone = TRUE;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CResizableDialog::OnDestroy()
{
CDialog::OnDestroy();
if (m_bEnableSaveRestore)
SaveWindowRect();
// remove old windows
m_arrLayout.RemoveAll();
}
void CResizableDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
if (m_bShowGrip && !IsZoomed())
{
// draw size-grip
dc.DrawFrameControl(&m_rcGripRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
}
}
void CResizableDialog::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType, cx, cy);
if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW)
return; // arrangement not needed
if (m_bInitDone)
{
ArrangeLayout();
}
}
UINT CResizableDialog::OnNcHitTest(CPoint point)
{
CPoint pt = point;
ScreenToClient(&pt);
// if in size grip and in client area
if (m_bShowGrip && m_rcGripRect.PtInRect(pt) &&
pt.x >= 0 && pt.y >= 0)
return HTBOTTOMRIGHT;
return CDialog::OnNcHitTest(point);
}
void CResizableDialog::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
if (!m_bInitDone)
return;
if (m_bUseMinTrack)
lpMMI->ptMinTrackSize = m_ptMinTrackSize;
if (m_bUseMaxTrack)
lpMMI->ptMaxTrackSize = m_ptMaxTrackSize;
if (m_bUseMaxRect)
{
lpMMI->ptMaxPosition = m_ptMaxPos;
lpMMI->ptMaxSize = m_ptMaxSize;
}
}
// layout functions
void CResizableDialog::AddAnchor(HWND wnd, CSize tl_type, CSize br_type)
{
ASSERT(wnd != NULL && ::IsWindow(wnd));
ASSERT(::IsChild(*this, wnd));
ASSERT(tl_type != NOANCHOR);
// get control's window class
CString st;
GetClassName(wnd, st.GetBufferSetLength(MAX_PATH), MAX_PATH);
st.ReleaseBuffer();
st.MakeUpper();
// add the style 'clipsiblings' to a GroupBox
// to avoid unnecessary repainting of controls inside
if (st == "BUTTON")
{
DWORD style = GetWindowLong(wnd, GWL_STYLE);
if (style & BS_GROUPBOX)
SetWindowLong(wnd, GWL_STYLE, style | WS_CLIPSIBLINGS);
}
// wnd classes that don't redraw client area correctly
// when the hor scroll pos changes due to a resizing
BOOL hscroll = FALSE;
if (st == "LISTBOX")
hscroll = TRUE;
// wnd classes that need refresh when resized
BOOL refresh = FALSE;
if (st == "STATIC")
{
DWORD style = GetWindowLong(wnd, GWL_STYLE);
switch (style & SS_TYPEMASK)
{
case SS_LEFT:
case SS_CENTER:
case SS_RIGHT:
// word-wrapped text needs refresh
refresh = TRUE;
}
// centered images or text need refresh
if (style & SS_CENTERIMAGE)
refresh = TRUE;
// simple text never needs refresh
if (style & SS_TYPEMASK == SS_SIMPLE)
refresh = FALSE;
}
// get dialog's and control's rect
CRect wndrc, objrc;
GetClientRect(&wndrc);
::GetWindowRect(wnd, &objrc);
ScreenToClient(&objrc);
CSize tl_margin, br_margin;
if (br_type == NOANCHOR)
br_type = tl_type;
// calculate margin for the top-left corner
tl_margin.cx = objrc.left - wndrc.Width() * tl_type.cx / 100;
tl_margin.cy = objrc.top - wndrc.Height() * tl_type.cy / 100;
// calculate margin for the bottom-right corner
br_margin.cx = objrc.right - wndrc.Width() * br_type.cx / 100;
br_margin.cy = objrc.bottom - wndrc.Height() * br_type.cy / 100;
// add to the list
Layout obj(wnd, tl_type, tl_margin, br_type, br_margin, hscroll, refresh);
m_arrLayout.Add(obj);
}
void CResizableDialog::ArrangeLayout()
{
// update size-grip
InvalidateRect(&m_rcGripRect);
UpdateGripPos();
InvalidateRect(&m_rcGripRect);
// init some vars
CRect wndrc;
GetClientRect(&wndrc);
int i, count = m_arrLayout.GetSize();
HDWP hdwp = BeginDeferWindowPos(count);
for (i=0; i<count; ++i)
{
Layout& obj = m_arrLayout[i];
CRect objrc, newrc;
CWnd* wnd = CWnd::FromHandle(obj.hwnd); // temporary solution
wnd->GetWindowRect(&objrc);
ScreenToClient(&objrc);
// calculate new top-left corner
newrc.left = obj.tl_margin.cx + wndrc.Width() * obj.tl_type.cx / 100;
newrc.top = obj.tl_margin.cy + wndrc.Height() * obj.tl_type.cy / 100;
// calculate new bottom-right corner
newrc.right = obj.br_margin.cx + wndrc.Width() * obj.br_type.cx / 100;
newrc.bottom = obj.br_margin.cy + wndrc.Height() * obj.br_type.cy / 100;
if (!newrc.EqualRect(&objrc))
{
if (obj.adj_hscroll)
{
// needs repainting, due to horiz scrolling
int diff = newrc.Width() - objrc.Width();
int max = wnd->GetScrollLimit(SB_HORZ);
obj.need_refresh = FALSE;
if (max > 0 && wnd->GetScrollPos(SB_HORZ) > max - diff)
{
obj.need_refresh = TRUE;
}
}
// set flags
DWORD flags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREPOSITION;
if (newrc.TopLeft() == objrc.TopLeft())
flags |= SWP_NOMOVE;
if (newrc.Size() == objrc.Size())
flags |= SWP_NOSIZE;
DeferWindowPos(hdwp, obj.hwnd, NULL, newrc.left, newrc.top,
newrc.Width(), newrc.Height(), flags);
}
}
// go re-arrange child windows
EndDeferWindowPos(hdwp);
// refresh those that need
for (i=0; i<count; ++i)
{
Layout& obj = m_arrLayout[i];
CWnd* wnd = CWnd::FromHandle(obj.hwnd); // temporary solution
if (obj.need_refresh)
{
wnd->Invalidate();
wnd->UpdateWindow();
}
}
}
void CResizableDialog::UpdateGripPos()
{
// size-grip goes bottom right in the client area
GetClientRect(&m_rcGripRect);
m_rcGripRect.left = m_rcGripRect.right - m_szGripSize.cx;
m_rcGripRect.top = m_rcGripRect.bottom - m_szGripSize.cy;
}
// protected members
void CResizableDialog::ShowSizeGrip(BOOL bShow)
{
if (m_bShowGrip != bShow)
{
m_bShowGrip = bShow;
InvalidateRect(&m_rcGripRect);
}
}
void CResizableDialog::SetMaximizedRect(const CRect& rc)
{
m_bUseMaxRect = TRUE;
m_ptMaxPos = rc.TopLeft();
m_ptMaxSize.x = rc.Width();
m_ptMaxSize.y = rc.Height();
}
void CResizableDialog::ResetMaximizedRect()
{
m_bUseMaxRect = FALSE;
}
void CResizableDialog::SetMinTrackSize(const CSize& size)
{
m_bUseMinTrack = TRUE;
m_ptMinTrackSize.x = size.cx;
m_ptMinTrackSize.y = size.cy;
}
void CResizableDialog::ResetMinTrackSize()
{
m_bUseMinTrack = FALSE;
}
void CResizableDialog::SetMaxTrackSize(const CSize& size)
{
m_bUseMaxTrack = TRUE;
m_ptMaxTrackSize.x = size.cx;
m_ptMaxTrackSize.y = size.cy;
}
void CResizableDialog::ResetMaxTrackSize()
{
m_bUseMaxTrack = FALSE;
}
// NOTE: this must be called after all the other settings
// to have the dialog and its controls displayed properly
void CResizableDialog::EnableSaveRestore(LPCTSTR pszSection, LPCTSTR pszEntry)
{
m_sSection = pszSection;
m_sEntry = pszEntry;
m_bEnableSaveRestore = TRUE;
LoadWindowRect();
}
// used to save/restore window's size and position
// either in the registry or a private .INI file
// depending on your application settings
#define PROFILE_FMT _T("%d,%d,%d,%d,%d,%d")
void CResizableDialog::SaveWindowRect()
{
CString data;
WINDOWPLACEMENT wp;
ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
wp.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(&wp);
RECT& rc = wp.rcNormalPosition; // alias
data.Format(PROFILE_FMT, rc.left, rc.top,
rc.right, rc.bottom, wp.showCmd, wp.flags);
AfxGetApp()->WriteProfileString(m_sSection, m_sEntry, data);
}
void CResizableDialog::LoadWindowRect()
{
CString data;
WINDOWPLACEMENT wp;
data = AfxGetApp()->GetProfileString(m_sSection, m_sEntry);
if (data.IsEmpty()) // never saved before
return;
ZeroMemory(&wp, sizeof(WINDOWPLACEMENT));
wp.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(&wp);
RECT& rc = wp.rcNormalPosition; // alias
if (_stscanf(data, PROFILE_FMT, &rc.left, &rc.top,
&rc.right, &rc.bottom, &wp.showCmd, &wp.flags) == 6)
{
SetWindowPlacement(&wp);
}
}

View File

@ -1,173 +0,0 @@
#if !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_)
#define AFX_RESIZABLEDIALOG_H__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ResizableDialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000 by Paolo Messina
// (ppescher@yahoo.com)
//
// Free for non-commercial use.
// You may change the code to your needs,
// provided that credits to the original
// author is given in the modified files.
//
/////////////////////////////////////////////////////////////////////////////
#include <afxtempl.h>
#include <afxwin.h>
// useful compatibility constants (the only one required is NOANCHOR)
#if !defined(__SIZE_ANCHORS_)
#define __SIZE_ANCHORS_
const CSize
NOANCHOR(-1,-1),
TOP_LEFT(0,0), TOP_CENTER(50,0), TOP_RIGHT(100,0),
MIDDLE_LEFT(0,50), MIDDLE_CENTER(50,50), MIDDLE_RIGHT(100,50),
BOTTOM_LEFT(0,100), BOTTOM_CENTER(50,100), BOTTOM_RIGHT(100,100);
#endif // !defined(__SIZE_ANCHORS_)
/////////////////////////////////////////////////////////////////////////////
// CResizableDialog window
class CResizableDialog : public CDialog
{
// Construction
public:
CResizableDialog();
CResizableDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL);
CResizableDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
// Attributes
private:
// flags
BOOL m_bShowGrip;
BOOL m_bUseMaxTrack;
BOOL m_bUseMinTrack;
BOOL m_bUseMaxRect;
BOOL m_bEnableSaveRestore;
// internal status
CString m_sSection; // section name and
CString m_sEntry; // entry for save/restore
BOOL m_bInitDone; // if all internal vars initialized
SIZE m_szGripSize; // set at construction time
CRect m_rcGripRect; // current pos of grip
POINT m_ptMinTrackSize; // min tracking size
POINT m_ptMaxTrackSize; // max tracking size
POINT m_ptMaxPos; // maximized position
POINT m_ptMaxSize; // maximized size
class Layout
{
public:
HWND hwnd;
BOOL adj_hscroll;
BOOL need_refresh;
// upper-left corner
CSize tl_type;
CSize tl_margin;
// bottom-right corner
CSize br_type;
CSize br_margin;
public:
Layout()
: hwnd(NULL), adj_hscroll(FALSE), need_refresh(FALSE),
tl_type(0,0), tl_margin(0,0),
br_type(0,0), br_margin(0,0)
{
};
Layout(HWND hw, SIZE tl_t, SIZE tl_m,
SIZE br_t, SIZE br_m, BOOL hscroll, BOOL refresh)
{
hwnd = hw;
adj_hscroll = hscroll;
need_refresh = refresh;
tl_type = tl_t;
tl_margin = tl_m;
br_type = br_t;
br_margin = br_m;
};
};
CArray<Layout, Layout&> m_arrLayout; // list of repositionable controls
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CResizableDialog)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CResizableDialog();
// used internally
private:
void Construct();
void LoadWindowRect();
void SaveWindowRect();
void ArrangeLayout();
void UpdateGripPos();
// callable from derived classes
//protected:
public:
void AddAnchor(HWND wnd, CSize tl_type,
CSize br_type = NOANCHOR); // add anchors to a control
void AddAnchor(UINT ctrl_ID, CSize tl_type,
CSize br_type = NOANCHOR) // add anchors to a control
{
AddAnchor(::GetDlgItem(*this, ctrl_ID), tl_type, br_type);
};
void ShowSizeGrip(BOOL bShow); // show or hide the size grip
void SetMaximizedRect(const CRect& rc); // set window rect when maximized
void ResetMaximizedRect(); // reset to default maximized rect
void SetMinTrackSize(const CSize& size); // set minimum tracking size
void ResetMinTrackSize(); // reset to default minimum tracking size
void SetMaxTrackSize(const CSize& size); // set maximum tracking size
void ResetMaxTrackSize(); // reset to default maximum tracking size
void EnableSaveRestore(LPCTSTR pszSection, LPCTSTR pszEntry); // section and entry in app's profile
// Generated message map functions
protected:
//{{AFX_MSG(CResizableDialog)
virtual BOOL OnInitDialog();
afx_msg UINT OnNcHitTest(CPoint point);
afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnDestroy();
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RESIZABLEDIALOG_H__INCLUDED_)

View File

@ -61,9 +61,9 @@ BOOL CStatsTab::OnInitDialog()
m_StatsListCtrl.InsertColumn(0, _T("Statistic"), LVCFMT_LEFT, m_colStats0Width); m_StatsListCtrl.InsertColumn(0, _T("Statistic"), LVCFMT_LEFT, m_colStats0Width);
m_StatsListCtrl.InsertColumn(1, _T("Value"), LVCFMT_LEFT, m_colStats1Width); m_StatsListCtrl.InsertColumn(1, _T("Value"), LVCFMT_LEFT, m_colStats1Width);
AddAnchor(IDC_STATSLIST, TOP_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_STATSLIST, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_SOURCELIST, TOP_LEFT, BOTTOM_LEFT); // AddAnchor(IDC_SOURCELIST, TOP_LEFT, BOTTOM_LEFT);
AddAnchor(IDC_FILLER1, BOTTOM_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_FILLER1, BOTTOM_LEFT, BOTTOM_RIGHT);
m_SourceListCtrl.SetSelectionMark(0); m_SourceListCtrl.SetSelectionMark(0);
m_SLS.SetFont(&(g_mainDialog->labelFont), TRUE); m_SLS.SetFont(&(g_mainDialog->labelFont), TRUE);

View File

@ -65,10 +65,10 @@ BOOL CStatus::OnInitDialog()
m_GlobalStatList.SetExtendedStyle(LVS_EX_FULLROWSELECT); m_GlobalStatList.SetExtendedStyle(LVS_EX_FULLROWSELECT);
// TODO: Add extra initialization here // TODO: Add extra initialization here
AddAnchor(IDC_FILLER2, BOTTOM_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_FILLER2, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_GLOBALSTAT_LIST, TOP_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_GLOBALSTAT_LIST, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_STATIC_RUN, BOTTOM_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_STATIC_RUN, BOTTOM_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_RUNNINGFOR, BOTTOM_LEFT, BOTTOM_RIGHT); // AddAnchor(IDC_RUNNINGFOR, BOTTOM_LEFT, BOTTOM_RIGHT);
m_GS.SetFont(&(g_mainDialog->labelFont), TRUE); m_GS.SetFont(&(g_mainDialog->labelFont), TRUE);

View File

@ -1,6 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "TabPageSSL.h" #include "TabPageSSL.h"
#include "ResizableDialog.h"
#ifdef _DEBUG #ifdef _DEBUG
#define new DEBUG_NEW #define new DEBUG_NEW
@ -18,7 +17,7 @@ CTabPageSSL::CTabPageSSL () {
} }
CTabPageSSL::CTabPageSSL (UINT nIDTemplate, CWnd* pParent /*=NULL*/) CTabPageSSL::CTabPageSSL (UINT nIDTemplate, CWnd* pParent /*=NULL*/)
: CResizableDialog(nIDTemplate, pParent) { : CDialog(nIDTemplate, pParent) {
#ifndef _AFX_NO_OCC_SUPPORT #ifndef _AFX_NO_OCC_SUPPORT
AfxEnableControlContainer (); AfxEnableControlContainer ();
#endif // !_AFX_NO_OCC_SUPPORT #endif // !_AFX_NO_OCC_SUPPORT
@ -47,7 +46,7 @@ void CTabPageSSL::OnCancel (void) {
BOOL CTabPageSSL::OnCommand (WPARAM wParam, LPARAM lParam) { BOOL CTabPageSSL::OnCommand (WPARAM wParam, LPARAM lParam) {
// Call base class OnCommand to allow message map processing // Call base class OnCommand to allow message map processing
CResizableDialog::OnCommand (wParam, lParam); CDialog::OnCommand (wParam, lParam);
// //
// Forward WM_COMMAND messages to the dialog's parent. // Forward WM_COMMAND messages to the dialog's parent.
// //
@ -58,7 +57,7 @@ BOOL CTabPageSSL::OnNotify (WPARAM wParam, LPARAM lParam, LRESULT* pResult) {
// //
// Forward WM_NOTIFY messages to the dialog's parent. // Forward WM_NOTIFY messages to the dialog's parent.
// //
CResizableDialog::OnNotify (wParam, lParam, pResult); CDialog::OnNotify (wParam, lParam, pResult);
return GetParent ()->SendMessage (WM_NOTIFY, wParam, lParam); return GetParent ()->SendMessage (WM_NOTIFY, wParam, lParam);
} }
@ -72,5 +71,5 @@ BOOL CTabPageSSL::OnCmdMsg (UINT nID, int nCode, void* pExtra,
return GetParent ()->OnCmdMsg (nID, nCode, pExtra, pHandlerInfo); return GetParent ()->OnCmdMsg (nID, nCode, pExtra, pHandlerInfo);
#endif // !_AFX_NO_OCC_SUPPORT #endif // !_AFX_NO_OCC_SUPPORT
return CResizableDialog::OnCmdMsg (nID, nCode, pExtra, pHandlerInfo); return CDialog::OnCmdMsg (nID, nCode, pExtra, pHandlerInfo);
} }

View File

@ -3,9 +3,8 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CTabPageSSL declaration // CTabPageSSL declaration
#include "ResizableDialog.h"
class CTabPageSSL : public CResizableDialog class CTabPageSSL : public CDialog
{ {
public: public:
// Construction // Construction

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 151 KiB