import bpy

from bpy.props import FloatProperty,      \
                      IntProperty,        \
                      EnumProperty


class OBJECT_OT_Bug(bpy.types.Operator):
    ''''''
    bl_idname = "object.bug"
    bl_label = "Bug"

    option = EnumProperty(
        name="Option",
        items=(("A", "A", ""),
               ("B", "B", ""),
               ),
        default= "A"
        )

    option_a = IntProperty(name="A Related", default=1)
    sub_option_a = FloatProperty(name="A Related Related")
    option_b = IntProperty(name="B Related", default=13)

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'

        col = layout.column()
        col.prop(self, "option")

        col.label(text="You picked {0}.".format(self.option))

        if self.option == 'A':
            row = col.row()
            row.prop(self, "option_a")
            sub=row.row()
            sub.active = self.option_a > 1
            sub.prop(self, "sub_option_a")

        elif self.option == 'B':
            row = col.row()
            row.prop(self, "option_b")


def register():
    bpy.utils.register_class(OBJECT_OT_Bug)


def unregister():
    bpy.utils.unregister_class(OBJECT_OT_Bug)


if __name__ == "__main__":
    register()
