⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 control.cpp

📁 做为linux下图形用户界面支持系统之一的MicroWindows采用C++设计
💻 CPP
字号:
//
// Micro Windows Implementation
// control.h
//
// $Revision: 1.2 $
// $Source: P:/MWINDOWS/LIB/rcs/control.cpp $
// $Date: 1993/11/27 09:53:32 $
//

// Control class does nothing but handles mouse class by its own.

#include "control.h"
#include "message.h"
#include "mouse.h"

Control::Control (Rect *prect, View *pparent, Model *client,
                  BOOL attach, BOOL killModel)
        :View (prect, pparent, client, FALSE, killModel)
{
    if (attach && parent) parent->attachSubview (this);
}

void Control::messageDispatcher (Message *msg)
{
    View::messageDispatcher (msg);
}

void Control::draw (Rect *area)
{
    Model *cli = NULL;

    if (clientModel)
    {
        cli = clientModel;
        clientModel = NULL;
    }

    View::draw (area);

    if (cli) clientModel = cli;
}

//
// dispatch mouse messages to methods of itself.
//
void Control::selfMouse (Message *msg)
{
    switch (msg->type)
    {
        case MSG_MouseMove:
            mouseMove (&(msg->pnt));
            return;

        case MSG_LeftButtonDown:
            leftButtonDown (&(msg->pnt));
            return;

        case MSG_LeftButtonUp:
            leftButtonUp (&(msg->pnt));
            return;
    }
}

void Control::selfDraw (Port *port, Rect *area)
{
    View::selfDraw (port, area);
}

void Control::mouseMove (Point *pnt)
{
}

void Control::leftButtonDown (Point *pnt)
{
}

void Control::leftButtonUp (Point *pnt)
{
}

⌨️ 快捷键说明

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