aboutsummaryrefslogtreecommitdiffstats
path: root/rfbplayer
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2004-12-12 07:02:51 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2004-12-12 07:02:51 +0000
commit7214b826c3e2e3c0ba95e67bf35d150d77550721 (patch)
tree49bea7fefc383f805643b5bb3da6013e635d6ffd /rfbplayer
parent79c97f820b19dfc5da21d9bf983e1b33687f7ebf (diff)
downloadtigervnc-7214b826c3e2e3c0ba95e67bf35d150d77550721.tar.gz
tigervnc-7214b826c3e2e3c0ba95e67bf35d150d77550721.zip
Removed old RfbPlayer's controls.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@37 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'rfbplayer')
-rw-r--r--rfbplayer/resource.h5
-rw-r--r--rfbplayer/rfbplayer.cxx149
2 files changed, 3 insertions, 151 deletions
diff --git a/rfbplayer/resource.h b/rfbplayer/resource.h
index f8ae33f1..0e24c68c 100644
--- a/rfbplayer/resource.h
+++ b/rfbplayer/resource.h
@@ -2,14 +2,9 @@
// Microsoft Developer Studio generated include file.
// Used by rfbplayer.rc
//
-#define IDD_DIALOGBAR 103
-#define IDI_ICON1 105
#define IDI_ICON 105
#define IDR_MENU 128
#define IDR_ACCELERATOR 131
-#define IDC_BUTTON1 1000
-#define IDC_EDIT1 1001
-#define IDC_EDIT2 1002
#define ID_FILE_OPENFILE 40011
#define ID_FILE_CLOSEFILE 40012
#define ID_FILE_EXIT 40013
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx
index dc0786cc..142ee95b 100644
--- a/rfbplayer/rfbplayer.cxx
+++ b/rfbplayer/rfbplayer.cxx
@@ -45,13 +45,6 @@ extern const char* buildTime;
#define strcasecmp _stricmp
-#define ID_START_BTN 0
-#define ID_POS_EDT 1
-#define ID_SPEED_EDT 2
-#define ID_POS_TXT 3
-#define ID_SPEED_TXT 4
-#define ID_CLIENT_STC 5
-
// -=- Custom thread class used to reading the rfb data
class CRfbThread : public Thread {
@@ -153,7 +146,7 @@ RfbPlayerClass::RfbPlayerClass() : classAtom(0) {
wndClass.cbWndExtra = 0;
wndClass.hInstance = instance = GetModuleHandle(0);
wndClass.hIcon = (HICON)LoadImage(GetModuleHandle(0),
- MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 0, 0, LR_SHARED);
+ MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 0, 0, LR_SHARED);
if (!wndClass.hIcon)
printf("unable to load icon:%ld", GetLastError());
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
@@ -282,128 +275,14 @@ RfbPlayer::~RfbPlayer() {
vlog.debug("~RfbPlayer done");
}
-// RfbPlayer control's tabstop processing
-
-WNDPROC OldProc[3];
-static HWND focusHwnd = 0;
-
-LRESULT CALLBACK TabProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
- int CONTROL_ID = GetWindowLong(hwnd, GWL_ID);
-
- if (msg == WM_DESTROY)
- SetWindowLong(hwnd, GWL_USERDATA, 0);
-
- RfbPlayer* _this = (RfbPlayer*) GetWindowLong(hwnd, GWL_USERDATA);
- if (!_this)
- return CallWindowProc(OldProc[CONTROL_ID], hwnd, msg, wParam, lParam);
-
- switch (msg) {
- case WM_KEYDOWN:
-
- // Process tab pressing
- if (wParam == VK_TAB) {
- switch (CONTROL_ID){
- case ID_START_BTN:
- focusHwnd = _this->getPosEdit();
- break;
- case ID_POS_EDT:
- focusHwnd = _this->getSpeedEdit();
- break;
- case ID_SPEED_EDT:
- focusHwnd = _this->getStartBtn();
- break;
- }
- SetFocus(focusHwnd);
- }
-
- // Process return/enter pressing (set the speed and the position)
- if (wParam == VK_RETURN) {
- switch (CONTROL_ID){
-
- // Change the position
-
- case ID_POS_EDT:
- {
- char posTxt[20];
- long pos;
- GetWindowText(_this->getPosEdit(), posTxt, 10);
- pos = atol(posTxt);
- if (pos != long(_this->getTimeOffset() / 1000) && (pos >= 0))
- _this->setPos(pos * 1000);
- else
- SetWindowText(_this->getPosEdit(), LongToStr(_this->getTimeOffset() / 1000));
- }
- break;
-
- // Change the playback speed
-
- case ID_SPEED_EDT:
- {
- char speedTxt[20];
- double speed;
- GetWindowText(_this->getSpeedEdit(), speedTxt, 10);
- speed = atof(speedTxt);
- if ((speed != _this->getSpeed()) && (speed != 0))
- _this->setSpeed(speed);
- else
- SetWindowText(_this->getSpeedEdit(), DoubleToStr(_this->getSpeed()));
- }
- break;
- }
- }
- break;
-
- case WM_SETFOCUS:
- focusHwnd = hwnd;
- break;
- }
-
- return CallWindowProc(OldProc[CONTROL_ID], hwnd, msg, wParam, lParam);
-}
-
LRESULT
RfbPlayer::processMainMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch (msg) {
// -=- Process standard window messages
-
- case WM_SETFOCUS:
- {
- if (focusHwnd)
- SetFocus(focusHwnd);
- else
- SetFocus(btnStart);
- }
- break;
case WM_CREATE:
{
- // Create the player controls
- if (showControls) {
- btnStart = CreateWindow("BUTTON", "Stop", WS_CHILD | WS_VISIBLE |
- BS_PUSHBUTTON | BS_NOTIFY, 5, 5, 60, 20, hwnd, (HMENU)ID_START_BTN,
- baseClass.instance, NULL);
- txtPos = CreateWindow("STATIC", "Position:", WS_CHILD | WS_VISIBLE,
- 70, 5, 60, 20, hwnd, (HMENU)ID_POS_TXT, baseClass.instance, NULL);
- editPos = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "0", WS_CHILD |
- WS_VISIBLE | ES_NUMBER |ES_RIGHT, 135, 5, 60, 20, hwnd,
- (HMENU)ID_POS_EDT, baseClass.instance, this);
- txtSpeed = CreateWindow("STATIC", "Speed:", WS_CHILD | WS_VISIBLE,
- 200, 5, 50, 20, hwnd, (HMENU)ID_SPEED_TXT, baseClass.instance, NULL);
- editSpeed = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "1.0", WS_CHILD |
- WS_VISIBLE | ES_RIGHT, 255, 5, 60, 20, hwnd, (HMENU)ID_SPEED_EDT,
- baseClass.instance, this);
-
- // Windows subclassing (It's used to implement "TabStop")
- OldProc[0] = (WNDPROC)SetWindowLong(btnStart, GWL_WNDPROC, (LONG)TabProc);
- OldProc[1] = (WNDPROC)SetWindowLong(editPos, GWL_WNDPROC, (LONG)TabProc);
- OldProc[2] = (WNDPROC)SetWindowLong(editSpeed, GWL_WNDPROC, (LONG)TabProc);
-
- SetWindowLong(btnStart, GWL_USERDATA, (long)this);
- SetWindowLong(editPos, GWL_USERDATA, (long)this);
- SetWindowLong(editSpeed, GWL_USERDATA, (long)this);
- }
-
// Create the frame window
frameHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, (const TCHAR*)frameClass.classAtom,
0, WS_CHILD | WS_VISIBLE, 0, CTRL_BAR_HEIGHT, 10, CTRL_BAR_HEIGHT + 10,
@@ -412,33 +291,11 @@ RfbPlayer::processMainMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0;
}
- // Process the start button messages
+ // Process the main menu and toolbar's messages
case WM_COMMAND:
{
- if ((LOWORD(wParam) == ID_START_BTN) && (HIWORD(wParam) == BN_CLICKED)) {
- if (is->isPaused()) {
- long pos;
- double speed;
- char str[20];
-
- // Change the playback speed
- GetWindowText(editSpeed, str, 10);
- speed = atof(str);
- if ((speed != getSpeed()) && (speed != 0))
- setSpeed(speed);
-
- // Change the position
- GetWindowText(editPos, str, 10);
- pos = atol(str);
- if (pos != long(getTimeOffset() / 1000))
- setPos(pos * 1000);
- setPaused(false);
- } else {
- setPaused(true);
- updatePos();
- }
- }
+
}
break;