Ejemplo n.º 1
0
        private void ProcessCreate(PenWebCallExpression methodCall)
        {
            HasCreateList.Add(methodCall.Class);

            switch (methodCall.Class)
            {
            case "CHorizontalSlider":
            case "CVerticalSlider":
                this.CreateWidgetTypeBinding(methodCall, PenWebWidgetType.SliderWidget);
                break;

            case "CBreastRightSideWnd":
            case "CBreastRightFrontWnd":
            case "CBreastLeftFrontWnd":
            case "CBreastLeftSideWnd":
            case "CBreastWnd":
                this.CreateWidgetTypeBinding(methodCall, PenWebWidgetType.BreastWidget);
                break;

            case "CLungMaskedAbnormalityWnd":
                break;

            case "CHitRegion":
                break;

            case "CMaskedAbnormalityWnd":
                break;

            case "CGiMaskedAbnormalityWnd":
                break;

            case "CDictaPhoneDlg":
                break;


            case "CClock":
                break;

            case "CDraggerStatic":
                break;

            case "CStatic":
                break;

            case "CButton":
                break;

            case "CPenradTextWnd":
                break;

            case "CPenradLogoWnd":
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        private void CatalogWidgetTypeFromDDX(PenWebCallExpression methodCall)
        {
            string typeName = methodCall.ParameterList[1].TypeName;

            DDXMethodSchema ddXMethodSchema;

            if (DDXMethods.ContainsKey(methodCall.Method))
            {
                ddXMethodSchema = DDXMethods[methodCall.Method];
            }
            else
            {
                ddXMethodSchema = new DDXMethodSchema()
                {
                    MethodName = methodCall.Method
                };

                DDXMethods.Add(methodCall.Method, ddXMethodSchema);
            }

            if (ddXMethodSchema.TypeList.ContainsKey(typeName))
            {
                ddXMethodSchema.TypeList[typeName]++;
            }
            else
            {
                ddXMethodSchema.TypeList.Add(typeName, 1);
            }

            if (ddXMethodSchema.DialogList.ContainsKey(this.CppCodeContext.DialogClassName))
            {
                ddXMethodSchema.DialogList[this.CppCodeContext.DialogClassName].Add(methodCall.Location.StartLine);
            }
            else
            {
                ddXMethodSchema.DialogList.Add(this.CppCodeContext.DialogClassName, new List <int>()
                {
                    methodCall.Location.StartLine
                });
            }
        }
Ejemplo n.º 3
0
        private void CreateWidgetTypeBinding(PenWebCallExpression methodCall, PenWebWidgetType penWebWidgetType)
        {
            string resourceLabel = null;

            ResourceIdContext resourceIdContext = null;

            switch (methodCall.ResourceIdContexts.Count)
            {
            case 0:
                break;

            case 1:
                resourceIdContext = methodCall.ResourceIdContexts[0];
                break;

            default:
                resourceIdContext = methodCall.ResourceIdContexts[0];
                break;
            }

            if (resourceIdContext == null)
            {
                if (methodCall.MacroReferences.Count > 0)
                {
                    resourceLabel = methodCall.MacroReferences[0];
                }
                else
                {
                }
            }

            WidgetTypeBinding widgetTypeBinding = new WidgetTypeBinding();

            widgetTypeBinding.FileName         = this.CppCodeContext.FileName;
            widgetTypeBinding.LineNumber       = methodCall.Location.StartLine;
            widgetTypeBinding.PenWebWidgetType = penWebWidgetType;
            widgetTypeBinding.ResourceLabel    = resourceLabel;

            if (!String.IsNullOrWhiteSpace(resourceLabel))
            {
                this.RegisterTypeBinding(widgetTypeBinding);
            }

            if (resourceIdContext == null)
            {
                IncompleteWidgetTypeBindings.Add(widgetTypeBinding);

                if (!HasIncompleteBindings.ContainsKey(this.CppCodeContext.DialogClassName))
                {
                    HasIncompleteBindings.Add(this.CppCodeContext.DialogClassName, 1);
                    HasIncompleteBinding = true;
                }
                else
                {
                    HasIncompleteBindings[this.CppCodeContext.DialogClassName]++;
                }

                return;
            }

            if (resourceIdContext != null)
            {
                if (!HasBinding)
                {
                    HasBindings.Add(this.CppCodeContext.DialogClassName, 1);
                    HasBinding = true;
                }
                else
                {
                    HasBindings[this.CppCodeContext.DialogClassName]++;
                }

                //widgetTypeBinding.ResourceId = resourceIdContext.ResourceId;

                this.RegisterTypeBinding(widgetTypeBinding);

                //this.WidgetTypeBindings.Add(widgetTypeBinding);
            }
            else
            {
                IncompleteWidgetTypeBindings.Add(widgetTypeBinding);

                if (!HasIncompleteBinding)
                {
                    HasIncompleteBindings.Add(this.CppCodeContext.DialogClassName, 1);
                    HasIncompleteBinding = true;
                }
                else
                {
                    HasIncompleteBindings[this.CppCodeContext.DialogClassName]++;
                }

                IncompleteWidgetTypeBindings.Add(widgetTypeBinding);
            }
        }
Ejemplo n.º 4
0
        private void CreateWidgetTypeFromDDX(PenWebCallExpression methodCall)
        {
            string typeName = methodCall.ParameterList[1].TypeName;

            string resourceLabel = null;

            int resourceId = -1;

            if (methodCall.MacroReferences.Count == 1)
            {
                resourceLabel = methodCall.MacroReferences[0];

                /*
                 * ResourceIdContext resourceIdContext = CppResourceManager.Self.GetResourceIdContextByLabel(resourceLabel);
                 *
                 * if (resourceIdContext != null)
                 * {
                 *
                 * }
                 * else
                 * {
                 *  Console.WriteLine($"Missing Resource Id Reference {resourceLabel}");
                 *  return;
                 * }
                 */
            }
            else
            {
                Console.WriteLine($"Missing Macro Reference");
                return;
            }

            WidgetTypeBinding widgetTypeBinding = new WidgetTypeBinding();

            widgetTypeBinding.FileName      = this.CppCodeContext.FileName;
            widgetTypeBinding.LineNumber    = methodCall.Location.StartLine;
            widgetTypeBinding.ResourceLabel = resourceLabel;
            //widgetTypeBinding.ResourceId = resourceId;
            widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.UnknownWidget;

            switch (methodCall.Method)
            {
            case "DDX_CBIndex":
            case "DDX_CBString":
            case "DDX_CBStringExact":
            case "DDX_LBIndex":
            case "DDX_LBString":
            case "DDX_LBStringExact":
            case "DDX_Radio":
            case "DDX_Text":
            case "DDX_Check":
                return;

            case "DDX_PenradDate":
                widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.DateTimeWidget;
                break;

            case "DDX_Control":
                switch (typeName)
                {
                case "CDateEdit":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.DateTimeWidget;
                    break;

                case "CPhoneEdit":
                case "CPhoneExtEdit":
                case "CSsnEdit":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.FormattedWidget;
                    break;

                case "CExListBox":
                case "CListBox":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.ListboxWidget;
                    break;

                case "CSliderCtrl":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.SliderWidget;
                    break;

                case "CAnimateCtrl":
                case "CButton":
                case "CButton[4]":
                case "CCalDayStatic":
                case "CComboBox":
                case "CDibWnd":
                case "CEdit":
                case "CEditWithWheelNotify":
                case "CSpinButtonCtrl":
                case "CStatic":
                case "CStatic[4]":
                    break;
                }

                break;

            case "DDX_ManagedControl":
                switch (typeName)
                {
                case "Microsoft::VisualC::MFC::CWinFormsControl<CDataGridView>":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.GridWidget;
                    break;

                case "Microsoft::VisualC::MFC::CWinFormsControl<CrystalDecisions::Windows::Forms::CrystalReportViewer>":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.CrystalViewer;
                    break;

                case "Microsoft::VisualC::MFC::CWinFormsControl<Penrad::PenCsLib::Browser>":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.HtmlViewer;
                    break;

                case "Microsoft::VisualC::MFC::CWinFormsControl<System::Windows::Forms::ListView>":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.ListboxWidget;
                    break;

                case "Microsoft::VisualC::MFC::CWinFormsControl<TXTextControl::TextControl>":
                    widgetTypeBinding.PenWebWidgetType = PenWebWidgetType.TxTextControl;
                    break;

                case "Microsoft::VisualC::MFC::CWinFormsControl<Penrad::PenCsLib::ZoomPicBox>":
                case "Microsoft::VisualC::MFC::CWinFormsControl<System::Windows::Forms::Button>":
                case "Microsoft::VisualC::MFC::CWinFormsControl<System::Windows::Forms::ComboBox>":
                case "Microsoft::VisualC::MFC::CWinFormsControl<System::Windows::Forms::Label>":
                case "Microsoft::VisualC::MFC::CWinFormsControl<System::Windows::Forms::PictureBox>":
                case "Microsoft::VisualC::MFC::CWinFormsControl<System::Windows::Forms::TextBox>":
                case "Microsoft::VisualC::MFC::CWinFormsControl<System::Windows::Forms::TrackBar>":
                    break;
                }
                break;

            default:
                break;
            }

            if (widgetTypeBinding.PenWebWidgetType != PenWebWidgetType.UnknownWidget)
            {
                this.RegisterTypeBinding(widgetTypeBinding);
            }
        }