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

📄 ybcommdesigneditors.cpp

📁 简单实用, 功能强大的 C++ Builder 串口控件! 本控件是免费的, 不需要注册, 有关授权及许可协议详见 license.txt 文件。 1.支持二进制数据和文本数据的收发 2.支
💻 CPP
字号:
//---------------------------------------------------------------------------


#pragma hdrstop

#include "YbCommDesignEditors.h"
#include "Unit_YBComm32_About.h"
#include "Unit_YbCommDevice_Settings.h"
//---------------------------------------------------------------------------

#pragma package(smart_init)
//---------------------------------------------------------------------------
namespace Ybcommdevice
{
    void __fastcall PACKAGE Register()
    {
         TComponentClass classes[1] = {__classid(TYbCommDevice)};
         RegisterComponents("Victor", classes, 0);
         RegisterComponentEditor(__classid(TYbCommDevice),__classid(TYbCommDeviceEditor));
    }
}
//---------------------------------------------------------------------------
void __fastcall TYbCommDeviceEditor::ExecuteVerb(int Index)
{
  if(Index == 0)
   {
     bool bPressedBtnOK;
     TForm_YbCommDevice_Settings *FormSettings;
     TYbCommDevice *lpComm = dynamic_cast<TYbCommDevice*>(Component);

     if(lpComm)
      {
        FormSettings = new TForm_YbCommDevice_Settings(NULL,lpComm,false);
        bPressedBtnOK = FormSettings->ShowModal() == IDOK;
        delete FormSettings;

        if(bPressedBtnOK)
         {
           Designer->Modified();
         }
      }
   }
  else
   {
     TForm_YBComm32_About *FormAbout = new TForm_YBComm32_About(NULL,Component->ClassName());
     FormAbout->ShowModal();
     delete FormAbout;
   }
}
//---------------------------------------------------------------------------
AnsiString __fastcall TYbCommDeviceEditor::GetVerb(int Index)
{
  if(Index == 0)
    return TForm_YBComm32_About::TMsgStrings().Str_Settings;
  return TForm_YBComm32_About::TMsgStrings().Str_MenuAbout;
}
//---------------------------------------------------------------------------
int __fastcall TYbCommDeviceEditor::GetVerbCount(void)
{
  return 2;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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