void CEntityDlg::OnNMReleasedcaptureSlider1( NMHDR *pNMHDR, LRESULT *pResult ) {
	if( !editEntity ) {
		return;
	}
	UpdateFromAnimationFrame();
	*pResult = 0;
}
void CEntityDlg::OnTimer( UINT nIDEvent ) {
	if( !editEntity ) {
		OnBnClickedStopAnimation();
		return;
	}
	if( currentAnimation ) {
		currentAnimationFrame = ( ( currentAnimationFrame + 1 ) % gameEdit->ANIM_GetNumFrames( currentAnimation ) );
		editEntity->epairs.SetInt( "frame" , currentAnimationFrame );
		slFrameSlider.SetPos( currentAnimationFrame );
		UpdateFromAnimationFrame( false/*don't update key/value display*/ );
		Sys_UpdateWindows( W_CAMERA | W_XY );
	}
}
BOOL CEntityDlg::PreTranslateMessage(MSG* pMsg)
{
// ---> sikk - Added
    //if ( pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_RBUTTONDOWN || pMsg->message == WM_MBUTTONDOWN ) {
    //	g_Inspectors->BringWindowToTop();
    //}
// <--- sikk - Added

    if (pMsg->hwnd == editVal.GetSafeHwnd()) {
        if (pMsg->message == WM_LBUTTONDOWN) {
            editVal.SetFocus();
//			return TRUE;	// sikk - Don't return so we can do default message handling
        }
    }

    if (pMsg->hwnd == editKey.GetSafeHwnd()) {
        if (pMsg->message == WM_LBUTTONDOWN) {
            editKey.SetFocus();
//			return TRUE;	// sikk - Don't return so we can do default message handling
        }
    }

    if (GetFocus() == &editVal || GetFocus() == &editKey) {
        if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
            AddProp();
            return TRUE;
        }

    }

    if (GetFocus() == listKeyVal.GetEditBox()) {
        if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
            listKeyVal.OnChangeEditBox();
            listKeyVal.OnSelchange();
            listKeyVal.OnKillfocusEditBox();
            AddProp();
            SetKeyValPairs();
            return TRUE;
        }
    }

    if (GetFocus() == &listKeyVal) {
        if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_DELETE && editEntity) {
            DelProp();
            return TRUE;
        }
    }

    if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
        if (pMsg->wParam == VK_ESCAPE) {
            g_pParentWnd->GetCamera()->SetFocus();
            Select_Deselect();
        }
        return TRUE;
    }

    if ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
        // keeps ENTER from closing the dialog
        return TRUE;
    }

    if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB) {
        if (GetFocus()) {
            int id = GetFocus()->GetDlgCtrlID();
            for (int i = 0; i < TabCount; i++) {
                if (TabOrder[i] == id) {
                    i++;
                    if (i >= TabCount) {
                        i = 0;
                    }
                    CWnd *next = GetDlgItem(TabOrder[i]);
                    if (next) {
                        next->SetFocus();
                        if (TabOrder[i] == IDC_EDIT_VAL) {
                            editVal.SetSel(0, -1);
                        }
                        return TRUE;
                    }
                }
            }
        }
    }

    if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RIGHT && pMsg->hwnd == slFrameSlider.GetSafeHwnd()) {
        int pos = slFrameSlider.GetPos() + 1;
        pos = (pos % slFrameSlider.GetRangeMax());
        slFrameSlider.SetPos ( pos );
        UpdateFromAnimationFrame ();
        return TRUE;
    }

    if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_LEFT && pMsg->hwnd == slFrameSlider.GetSafeHwnd()) {
        int pos = slFrameSlider.GetPos() - 1;

        if ( pos < 1 ) {
            pos = slFrameSlider.GetRangeMax();
        }

        slFrameSlider.SetPos ( pos );
        UpdateFromAnimationFrame ();
        return TRUE;
    }

    return CDialog::PreTranslateMessage(pMsg);
}