window.cpp

来自「A*算法 A*算法 A*算法 A*算法A*算法A*算法」· C++ 代码 · 共 760 行 · 第 1/2 页

CPP
760
字号
int wxWindowPalm::GetScrollThumb(int orient) const
{
    return 0;
}

void wxWindowPalm::SetScrollPos(int orient, int pos, bool refresh)
{
}

// New function that will replace some of the above.
void wxWindowPalm::SetScrollbar(int orient,
                               int pos,
                               int pageSize,
                               int range,
                               bool refresh)
{
}

void wxWindowPalm::ScrollWindow(int dx, int dy, const wxRect *prect)
{
}

bool wxWindowPalm::ScrollLines(int lines)
{
    return false;
}

bool wxWindowPalm::ScrollPages(int pages)
{
    return false;
}

// ----------------------------------------------------------------------------
// Style handling
// ----------------------------------------------------------------------------

WXDWORD wxWindowPalm::PalmGetStyle(long flags, WXDWORD *exstyle) const
{
    return 0;
}

// Setup background and foreground colours correctly
void wxWindowPalm::SetupColours()
{
}

void wxWindowPalm::OnInternalIdle()
{
}

// Set this window to be the child of 'parent'.
bool wxWindowPalm::Reparent(wxWindowBase *parent)
{
    return false;
}

void wxWindowPalm::Freeze()
{
}

void wxWindowPalm::Thaw()
{
}

void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
{
    WinHandle handle = (WinHandle)GetWinHandle();
    if(handle)
    {
        if(rect)
        {
            RectangleType dirtyRect;
            dirtyRect.topLeft.x = rect->GetX() - 1;
            dirtyRect.topLeft.y = rect->GetY() - 1;
            dirtyRect.extent.x = rect->GetWidth() + 1;
            dirtyRect.extent.y = rect->GetHeight() + 1;
            WinInvalidateRect(handle, &dirtyRect);
        }
        else
        {
            WinInvalidateWindow(handle);
        }
    }
}

void wxWindowPalm::Update()
{
}

// ---------------------------------------------------------------------------
// drag and drop
// ---------------------------------------------------------------------------


#if wxUSE_DRAG_AND_DROP
void wxWindowPalm::SetDropTarget(wxDropTarget *pDropTarget)
{
}
#endif // wxUSE_DRAG_AND_DROP

// old style file-manager drag&drop support: we retain the old-style
// DragAcceptFiles in parallel with SetDropTarget.
void wxWindowPalm::DragAcceptFiles(bool accept)
{
}

// ----------------------------------------------------------------------------
// tooltips
// ----------------------------------------------------------------------------

#if wxUSE_TOOLTIPS

void wxWindowPalm::DoSetToolTip(wxToolTip *tooltip)
{
}

#endif // wxUSE_TOOLTIPS

// ---------------------------------------------------------------------------
// moving and resizing
// ---------------------------------------------------------------------------

// Get total size
void wxWindowPalm::DoGetSize(int *x, int *y) const
{
}

// Get size *available for subwindows* i.e. excluding menu bar etc.
void wxWindowPalm::DoGetClientSize(int *x, int *y) const
{
}

void wxWindowPalm::DoGetPosition(int *x, int *y) const
{
    if(x)
        *x = 0;
    if(y)
        *y = 0;
}

void wxWindowPalm::DoScreenToClient(int *x, int *y) const
{
}

void wxWindowPalm::DoClientToScreen(int *x, int *y) const
{
}

void wxWindowPalm::DoMoveWindow(int x, int y, int width, int height)
{
}

// set the size of the window: if the dimensions are positive, just use them,
// but if any of them is equal to -1, it means that we must find the value for
// it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in
// which case -1 is a valid value for x and y)
//
// If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate
// the width/height to best suit our contents, otherwise we reuse the current
// width/height
void wxWindowPalm::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
    // get the current size and position...
    int currentX, currentY;
    GetPosition(&currentX, &currentY);
    int currentW,currentH;
    GetSize(&currentW, &currentH);

    // ... and don't do anything (avoiding flicker) if it's already ok
    if ( x == currentX && y == currentY &&
         width == currentW && height == currentH )
    {
        return;
    }

    if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
        x = currentX;
    if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
        y = currentY;

    AdjustForParentClientOrigin(x, y, sizeFlags);

    wxSize size = wxDefaultSize;
    if ( width == wxDefaultCoord )
    {
        if ( sizeFlags & wxSIZE_AUTO_WIDTH )
        {
            size = DoGetBestSize();
            width = size.x;
        }
        else
        {
            // just take the current one
            width = currentW;
        }
    }

    if ( height == wxDefaultCoord )
    {
        if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
        {
            if ( size.x == wxDefaultCoord )
            {
                size = DoGetBestSize();
            }
            //else: already called DoGetBestSize() above

            height = size.y;
        }
        else
        {
            // just take the current one
            height = currentH;
        }
    }

    DoMoveWindow(x, y, width, height);
}

void wxWindowPalm::DoSetClientSize(int width, int height)
{
}

// ---------------------------------------------------------------------------
// text metrics
// ---------------------------------------------------------------------------

int wxWindowPalm::GetCharHeight() const
{
    return 0;
}

int wxWindowPalm::GetCharWidth() const
{
    return 0;
}

void wxWindowPalm::GetTextExtent(const wxString& string,
                             int *x, int *y,
                             int *descent, int *externalLeading,
                             const wxFont *theFont) const
{
}

// ---------------------------------------------------------------------------
// popup menu
// ---------------------------------------------------------------------------

#if wxUSE_MENUS_NATIVE

// yield for WM_COMMAND events only, i.e. process all WM_COMMANDs in the queue
// immediately, without waiting for the next event loop iteration
//
// NB: this function should probably be made public later as it can almost
//     surely replace wxYield() elsewhere as well
static void wxYieldForCommandsOnly()
{
}

bool wxWindowPalm::DoPopupMenu(wxMenu *menu, int x, int y)
{
    return false;
}

#endif // wxUSE_MENUS_NATIVE

// ----------------------------------------------------------------------------
// wxWindow <-> HWND map
// ----------------------------------------------------------------------------

wxWinHashTable *wxWinHandleHash = NULL;

wxWindow *wxFindWinFromWinHandle(WXWINHANDLE handle)
{
    // TODO
    return NULL;
}

void wxRemoveHandleAssociation(wxWindowPalm *win)
{
}

// ----------------------------------------------------------------------------
// various Palm specific class dependent functions
// ----------------------------------------------------------------------------

bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos,
                                             const wxSize& size,
                                             int& x, int& y,
                                             int& w, int& h) const
{
    return false;
}

bool wxWindowPalm::PalmCreate(const wxChar *wclass,
                              const wxChar *title,
                              const wxPoint& pos,
                              const wxSize& size,
                              WXDWORD style,
                              WXDWORD extendedStyle)
{
    return false;
}

// ===========================================================================
// Palm message handlers
// ===========================================================================

// ---------------------------------------------------------------------------
// painting
// ---------------------------------------------------------------------------

// Can be called from an application's OnPaint handler
void wxWindowPalm::OnPaint(wxPaintEvent& event)
{
}

void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
{
}

// ---------------------------------------------------------------------------
// moving and resizing
// ---------------------------------------------------------------------------

bool wxWindowPalm::HandleMove(int x, int y)
{
    return false;
}

bool wxWindowPalm::HandleMoving(wxRect& rect)
{
    return false;
}

// ---------------------------------------------------------------------------
// joystick
// ---------------------------------------------------------------------------

bool wxWindowPalm::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags)
{
    return false;
}

// ---------------------------------------------------------------------------
// scrolling
// ---------------------------------------------------------------------------

bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
                                WXWORD pos, WXWINHANDLE control)
{
    // TODO
    return false;
}

// ===========================================================================
// global functions
// ===========================================================================

void wxGetCharSize(WXWINHANDLE wnd, int *x, int *y, const wxFont *the_font)
{
    // TODO
}

#if wxUSE_HOTKEY

bool wxWindowPalm::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
{
    return false;
}

bool wxWindowPalm::UnregisterHotKey(int hotkeyId)
{
    return false;
}

#endif // wxUSE_HOTKEY


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?