destroymenu

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5572165936844014&dt=1193665761703&lmt=1193665780&format=336x280_as&output=html&correlator=1193665761687&url=http%3A%2F%2Fwww.codeguru.cn%2Fpublic%2Fiframe%2Fwinapiiframe.htm&color_bg=FFFFFF&color_text=000000&color_link=000000&color_url=FFFFFF&color_border=FFFFFF&ad_type=text&ga_vid=1285758818.1193665762&ga_sid=1193665762&ga_hid=111695597&flash=9&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_his=8&u_java=true" frameborder="0" width="336" scrolling="no" height="280" allowtransparency="allowtransparency">     函数动能:该函数销毁指定的菜单,并释放此菜单占用的存储器。

    函数原型:BOOL DestroyMenu(HMENU hMenu);

    参数:

    hMenu:要销毁的菜单的句柄。

    返回值:如果函数调用成功,返回非零值;如果函数调用失败,返回值是零。若想获得更多的错误信息,请调用GetLastError函数。

    备注:一个应用程序在关闭之前,必须调用函数DestroyMenu来销毁一个没被分配给窗口的菜单。分配给窗口的菜单,当应用程序关闭时,被自动销毁。

    速查:Windows NT:3.1及以上版本;Windows:95及以上版本;Windows CE:1.0及以上版本;头文件:winuser.h;输入库:user32.lib。

/**************************************************************************** ** ** This file is part of the LibreCAD project, a 2D CAD program ** ** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl) ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. ** ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file gpl-2.0.txt included in the ** packaging of this file. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ** ** This copyright notice MUST APPEAR in all copies of the script! ** **********************************************************************/ #ifndef QC_GRAPHICVIEW_H #define QC_GRAPHICVIEW_H #include <QWidget> #include "rs_document.h" #include "rs_eventhandler.h" #include "qg_graphicview.h" class QC_ApplicationWindow; /** * A view widget for the visualisation of drawings. * Very thin wrapper for LibreCAD specific settings. * * @author Andrew Mustun */ class QC_GraphicView : public QG_GraphicView { Q_OBJECT public: QC_GraphicView(RS_Document* doc, QWidget* parent=0); virtual ~QC_GraphicView()=default; private: //RS_Document* document; }; #endif /**************************************************************************** ** ** This file is part of the LibreCAD project, a 2D CAD program ** ** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl) ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. ** ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file gpl-2.0.txt included in the ** packaging of this file. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ** ** This copyright notice MUST APPEAR in all copies of the script! ** **********************************************************************/ #ifndef QG_GRAPHICVIEW_H #define QG_GRAPHICVIEW_H #include <QWidget> #include "rs_graphicview.h" #include "rs_layerlistlistener.h" #include "rs_blocklistlistener.h" class QGridLayout; class QLabel; class QMenu; class QG_ScrollBar; /** * This is the Qt implementation of a widget which can view a * graphic. * * Instances of this class can be linked to layer lists using * addLayerListListener(). */ class QG_GraphicView: public RS_GraphicView, public RS_LayerListListener, public RS_BlockListListener { Q_OBJECT public: QG_GraphicView(QWidget* parent = 0, Qt::WindowFlags f = 0, RS_Document* doc = 0); ~QG_GraphicView() override; int getWidth() const override; int getHeight() const override; void redraw(RS2::RedrawMethod method=RS2::RedrawAll) override; void adjustOffsetControls() override; void adjustZoomControls() override; void setBackground(const RS_Color& bg) override; void setMouseCursor(RS2::CursorType c) override; void updateGridStatusWidget(const QString& text) override; virtual void getPixmapForView(std::unique_ptr<QPixmap>& pm); // Methods from RS_LayerListListener Interface: void layerEdited(RS_Layer*) override{ redraw(RS2::RedrawDrawing); } void layerRemoved(RS_Layer*) override{ redraw(RS2::RedrawDrawing); } void layerToggled(RS_Layer*) override{ redraw(RS2::RedrawDrawing); } void layerActivated(RS_Layer *) override; /** * @brief setOffset * @param ox, offset X * @param oy, offset Y */ void setOffset(int ox, int oy) override; /** * @brief getMousePosition() mouse position in widget coordinates * @return the cursor position in widget coordinates * returns the widget center, if cursor is not on the widget */ RS_Vector getMousePosition() const override; void setAntialiasing(bool state); void setCursorHiding(bool state); void addScrollbars(); bool hasScrollbars(); void setCurrentQAction(QAction* q_action); QString device; void destroyMenu(const QString& activator); void setMenu(const QString& activator, QMenu* menu); protected: void mousePressEvent(QMouseEvent* e) override; void mouseDoubleClickEvent(QMouseEvent* e) override; void mouseReleaseEvent(QMouseEvent* e) override; void mouseMoveEvent(QMouseEvent* e) override; void tabletEvent(QTabletEvent* e) override; void leaveEvent(QEvent*) override; void enterEvent(QEvent*) override; void focusInEvent(QFocusEvent*) override; void focusOutEvent(QFocusEvent*) override; void wheelEvent(QWheelEvent* e) override; void keyPressEvent(QKeyEvent* e) override; void keyReleaseEvent(QKeyEvent* e) override; bool event(QEvent * e) override; void paintEvent(QPaintEvent *)override; void resizeEvent(QResizeEvent* e) override; QList<QAction*> recent_actions; private slots: void slotHScrolled(int value); void slotVScrolled(int value); protected: //! Horizontal scrollbar. QG_ScrollBar* hScrollBar; //! Vertical scrollbar. QG_ScrollBar* vScrollBar; //! Layout used to fit in the view and the scrollbars. QGridLayout* layout; //! CAD mouse cursor std::unique_ptr<QCursor> curCad; //! Delete mouse cursor std::unique_ptr<QCursor> curDel; //! Select mouse cursor std::unique_ptr<QCursor> curSelect; //! Magnifying glass mouse cursor std::unique_ptr<QCursor> curMagnifier; //! Hand mouse cursor std::unique_ptr<QCursor> curHand; // Used for buffering different paint layers std::unique_ptr<QPixmap> PixmapLayer1; // Used for grids and absolute 0 std::unique_ptr<QPixmap> PixmapLayer2; // Used for the actual CAD drawing std::unique_ptr<QPixmap> PixmapLayer3; // Used for crosshair and actionitems RS2::RedrawMethod redrawMethod; //! Keep tracks of if we are currently doing a high-resolution scrolling bool isSmoothScrolling; QMap<QString, QMenu*> menus; private: bool antialiasing{false}; bool scrollbars{false}; bool cursor_hiding{false}; signals: void xbutton1_released(); void gridStatusChanged(const QString&); }; #endif 这两个类的区别是什么,如果我要写一个2dcad,我一个怎么为我两个类似的类命名?
最新发布
07-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值