[Lldb-commits] [PATCH] D104395: [LLDB][GUI] Add initial forms support

Omar Emara via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 30 13:12:46 PDT 2021


OmarEmaraDev added a comment.

Full example:

F17684763: 20210630-220202.mp4 <https://reviews.llvm.org/F17684763>

Example API definition for the above example:

  class TestFormDelegate : public FormDelegate {
  public:
    TestFormDelegate() {
      m_text_field = AddTextField("Text", "The big brown fox.");
      m_file_field = AddFileField("File", "/tmp/a");
      m_directory_field = AddDirectoryField("Directory", "/tmp/");
      m_pid_field = AddIntegerField("Number", 5);
      std::vector<std::string> choices;
      choices.push_back(std::string("Choice 1"));
      choices.push_back(std::string("Choice 2"));
      choices.push_back(std::string("Choice 3"));
      choices.push_back(std::string("Choice 4"));
      choices.push_back(std::string("Choice 5"));
      m_choices_field = AddChoicesField("Choices", 3, choices);
      m_bool_field = AddBooleanField("Boolean", true);
      TextFieldDelegate default_field =
          TextFieldDelegate("Text", "The big brown fox.");
      m_text_list_field = AddListField("Text List", default_field);
  
      AddAction("Submit", [this](Window &window) { Submit(window); });
    }
  
    void Submit(Window &window) { SetError("An example error."); }
  
  protected:
    TextFieldDelegate *m_text_field;
    FileFieldDelegate *m_file_field;
    DirectoryFieldDelegate *m_directory_field;
    IntegerFieldDelegate *m_pid_field;
    BooleanFieldDelegate *m_bool_field;
    ChoicesFieldDelegate *m_choices_field;
    ListFieldDelegate<TextFieldDelegate> *m_text_list_field;
  };


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104395/new/

https://reviews.llvm.org/D104395



More information about the lldb-commits mailing list