예제 #1
0
 internal static void PluginCleanUp()
 {
     pluginSettings.save();
     if (frmAboutprt != null)
     {
         frmAboutprt.Close();
         frmAboutprt = null;
     }
     if (frmSettings != null)
     {
         frmSettings.Close();
         frmSettings = null;
     }
     if (frmChangeCod != null)
     {
         frmChangeCod.Close();
         frmChangeCod = null;
     }
     if (frmChangeid != null)
     {
         frmChangeid.Close();
         frmChangeid = null;
     }
     if (frmCompare != null)
     {
         frmCompare.Close();
         frmCompare = null;
     }
     if (frmPolar != null)
     {
         frmPolar.Close();
         frmPolar = null;
     }
     if (frmRotate != null)
     {
         frmRotate.Close();
         frmRotate = null;
     }
     if (frmTransform != null)
     {
         frmTransform.Close();
         frmTransform = null;
     }
     if (frmTranslate != null)
     {
         frmTranslate.Close();
         frmTranslate = null;
     }
 }
예제 #2
0
        /// <summary>Anzeige Instrumenten- / Reflektorhöhen-tausch/setzt Dialog</summary>
        internal static void rotateCoordDialog()
        {
            if (frmRotate == null)
            {
                frmRotate = new frmRotateCoord(ref pluginLanguage, ref cADdyPoints);
                frmRotate.setFromSetting(ref pluginSettings, ref notepad);
                using (Bitmap newBmp = new Bitmap(16, 16))
                {
                    Graphics   g        = Graphics.FromImage(newBmp);
                    ColorMap[] colorMap = new ColorMap[1];
                    colorMap[0]          = new ColorMap();
                    colorMap[0].OldColor = Color.Fuchsia;
                    colorMap[0].NewColor = Color.FromKnownColor(KnownColor.ButtonFace);
                    ImageAttributes attr = new ImageAttributes();
                    attr.SetRemapTable(colorMap);
                    g.DrawImage(rotate, new Rectangle(0, 0, 16, 16), 0, 0, 16, 16, GraphicsUnit.Pixel, attr);
                    tbIcon = Icon.FromHandle(newBmp.GetHicon());
                }

                NppTbData _nppTbData = new NppTbData();
                _nppTbData.hClient       = frmRotate.Handle;
                _nppTbData.pszName       = pluginLanguage.getLanguageText("frmRotateCoord_Title");;
                _nppTbData.dlgID         = idFrmRotate;
                _nppTbData.uMask         = NppTbMsg.DWS_DF_CONT_RIGHT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR;
                _nppTbData.hIconTab      = (uint)tbIcon.Handle;
                _nppTbData.pszModuleName = PluginName;
                IntPtr _ptrNppTbData = Marshal.AllocHGlobal(Marshal.SizeOf(_nppTbData));
                Marshal.StructureToPtr(_nppTbData, _ptrNppTbData, false);

                Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMREGASDCKDLG, 0, _ptrNppTbData);
            }
            else
            {
                Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMSHOW, 0, frmChangeid.Handle);
            }
            frmRotate.readCuDatas();
        }
예제 #3
0
        /// <summary>Tabreiter wurde aktiviert!</summary>
        internal static void bufferIsActivated()
        {
            if (!Main.isFuctionSwitch)
            {
                Main.cuTabWhatIsThis = ClassCADdyWhatIAm.check(pluginSettings);

                if (cuTabWhatIsThis != enWhatIAm.CADdyCoord)
                {
                    if (cuTabWhatIsThis == enWhatIAm.CADdyMeasure)
                    {
                        Main.cADdyMessdaten.getMeasuresFromCurrentCADdy(Main.pluginSettings);
                        Main.cADdyPoints.clear();
                    }
                }
                else if (cuTabWhatIsThis == enWhatIAm.CADdyCoord)
                {
                    Main.cADdyPoints.getPointsFromCurrentCADdy(Main.pluginSettings);
                    Main.cADdyMessdaten.clear();
                }
                else
                {
                }
                int num = ClassNPPTools.getOpenFileCount() - 1;


                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_FormCADdy, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_FormExcel, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_SortCol1, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_SortCol2, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_SortCol3, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_SortCol4, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_SortCol5, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_Rotation, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_Translation, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_Transformation, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord && num == 2);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_Polar, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_Compare, Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord && num == 2);

                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Measure_FormCADdy, Main.cuTabWhatIsThis == enWhatIAm.CADdyMeasure);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Measure_FormExcel, Main.cuTabWhatIsThis == enWhatIAm.CADdyMeasure);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Measure_FormCAPLAN, Main.cuTabWhatIsThis == enWhatIAm.CADdyMeasure);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Measure_SetID, Main.cuTabWhatIsThis == enWhatIAm.CADdyMeasure);

                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_ChangeCode, Main.cuTabWhatIsThis > enWhatIAm.iDontKnown);


                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord, false);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Coord_Sort, false);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Measure, false);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_MeasCode, false);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Dummy_1, false);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Dummy_2, false);
                ClassNPPTools.enablePluginMenuFunction((int)CADdyToolsMenuId.Menue_Dummy_3, false);

                if (Main.frmChangeCod != null)
                {
                    if (Main.cuTabWhatIsThis != enWhatIAm.iDontKnown)
                    {
                        Main.frmChangeCod.readCuDatas();
                    }
                    else
                    {
                        Main.frmChangeCod.closeMe();
                        Main.frmChangeCod.Dispose();
                        Main.frmChangeCod = null;
                    }
                }
                if (Main.frmChangeid != null)
                {
                    if (Main.cuTabWhatIsThis == enWhatIAm.CADdyMeasure)
                    {
                        Main.frmChangeid.readCuDatas();
                    }
                    else
                    {
                        Main.frmChangeid.closeMe();
                        Main.frmChangeid.Dispose();
                        Main.frmChangeid = null;
                    }
                }
                if (Main.cuTabWhatIsThis == enWhatIAm.CADdyCoord)
                {
                    if (Main.frmRotate != null)
                    {
                        Main.frmRotate.readCuDatas();
                    }
                    if (Main.frmPolar != null)
                    {
                        Main.frmPolar.readCuDatas();
                    }
                    if (Main.frmTranslate != null)
                    {
                        Main.frmTranslate.readCuDatas();
                    }
                    if (num != 2)
                    {
                        if (Main.frmCompare != null)
                        {
                            Main.frmCompare.closeMe();
                            Main.frmCompare.Dispose();
                            Main.frmCompare = null;
                        }
                        if (Main.frmTransform != null)
                        {
                            Main.frmTransform.closeMe();
                            Main.frmTransform.Dispose();
                            Main.frmTransform = null;
                            return;
                        }
                    }
                }
                else
                {
                    if (Main.frmRotate != null)
                    {
                        Main.frmRotate.closeMe();
                        Main.frmRotate.Dispose();
                        Main.frmRotate = null;
                    }
                    if (Main.frmPolar != null)
                    {
                        Main.frmPolar.closeMe();
                        Main.frmPolar.Dispose();
                        Main.frmPolar = null;
                    }
                    if (Main.frmCompare != null)
                    {
                        Main.frmCompare.closeMe();
                        Main.frmCompare.Dispose();
                        Main.frmCompare = null;
                    }
                    if (Main.frmTranslate != null)
                    {
                        Main.frmTranslate.closeMe();
                        Main.frmTranslate.Dispose();
                        Main.frmTranslate = null;
                    }
                    if (Main.frmTransform != null)
                    {
                        Main.frmTransform.closeMe();
                        Main.frmTransform.Dispose();
                        Main.frmTransform = null;
                    }
                }
            }
        }