Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

46
LINES

< > BotCompany Repo | #1020308 // List Maker [dev.]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (18072L/133K).

!7

concept AList {
  S name, comment;
  Int length; // if known
  long lastChanged;
  
  // All other fields are dynamic (in fieldValues).
}

sclass ListMaker > DynCRUD<AList> {
  bool voiceMode = true;
  
  *() { super(AList); }
  
  start {
    dm_onTopInput(voidfunc(S s) { if (voiceMode) reactToInput(s) });
  }
  
  void reactToInput(fS s) {
    switch to dm_q();
    if (matchEnd_vbar("new list", s))
      addDialog();
  }
  
  void addDialog enter {
    dm_say("Making a list");
    final JTextField tfName = jTextField();
    dm_callModule(dm_voiceTargetsModule(), 'addVoiceTarget, dm_moduleID(), tfName, func(S s) -> bool {
      if "cancel" ret true with disposePIFrame(tfName);
      false;
    });
    showFormTitled("Name for new list",
      "Name", tfName, r {
        name = or2(gtt(tfName), "A list made on " + ymd_hms());
        cnew(AList, +name, lastChanged := now());
      });
    dm_say("What should it be called?");
  }
  
  visualize {
    ret northAndCenter(
      withMargin(dm_fieldCheckBox('voiceMode)),
      super.visualize());
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020308
Snippet name: List Maker [dev.]
Eternal ID of this version: #1020308/12
Text MD5: dfa235cbac73dd40e0ccd8da6d64ae8f
Transpilation MD5: c70d84f52e50f9add27cebea7f2e27ff
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-14 00:25:45
Source code size: 1112 bytes / 46 lines
Pitched / IR pitched: No / No
Views / Downloads: 222 / 1659
Version history: 11 change(s)
Referenced in: [show references]