quote:
Originally posted by couturier
@Castiel
Thanks a lot Castiel, this is exactly what I was looking for.
I have a few additionnal questions
- Could you tell me where is the corresponding help documentation ?
- Is there an option to specify file type ?
- Is there a way to dynamically add items in the GETNBOX, based on the number of selected files ? Sort of like the impExcel Xf that dynamically add GETN_CHECK items for each sheet of the selected file.
@Greg
Thanks for those examples.
The release notes don't mention it. Is there a full documentation of the new features ?
- No documentation, as far as I can see.
- File type:
- "...Files:ASCII"
- "...Files:[ASCII (*.dat,*.txt)] *.dat;*.txt|[All (*.*)] *.*"]
- See GetN_option_event().
void MultilineEditWithButton()
{
GETN_BOX(trMultilineEditWithButton);
TreeNode tn = GETN_CURRENT_NODE.AddNode("MultilineEdit");
tn.SetAttribute(STR_ID_ATTRIB, TRGP_STR_BUTTON);
tn.SetAttribute(STR_LABEL_ATTRIB, "File Name");
tn.SetAttribute(STR_COMBO_ATTRIB, "...Files:[ASCII (*.dat,*.txt)] *.dat;*.txt|[All (*.*)] *.*");
tn.SetAttribute(STR_MULTI_EDT_EXPSHR_ATTRIB, 1);
tn.SetAttribute(STR_ATTRIB_MULTILINE_EDIT_DISPLAY_ROW_HEIGHT_RANGE, "5-12");
tn.SetAttribute(STR_ATTRIB_EDIT_DISPLAY_WIDTH_RANGE, "50-100");
tn.SetAttribute(STR_ATTRIB_HANDLER, GetN_option_event);
GetNBox(trMultilineEditWithButton);
}
bool GetN_option_event(TreeNode& myTree, int nRow, int nType, Dialog& theDlg)
{
if((TRGP_STR_BUTTON == nType || ONODETYPE_EDIT_BOX_ONELINE_TEXT == nType)&& nRow >= 0)
{
string strPath = myTree.MultilineEdit.strVal;
StringArray sa;
strPath.GetTokens(sa,'\n');
if(myTree.selected.IsValid())
myTree.selected.Remove();
if(sa.GetSize())
{
myTree.AddNode("selected");
for(int i = 0; i < sa.GetSize(); i++)
{
if(!sa[i].IsEmpty())
{
TreeNode tnCheck = myTree.selected.AddNode("fileName"+(i+1));
tnCheck.SetAttribute(STR_ID_ATTRIB, TRGP_CHECK);
tnCheck.nVal = 1;
tnCheck.SetAttribute(STR_LABEL_ATTRIB, GetFileName(sa[i]));
}
}
if(!myTree.selected.Children.Count())
myTree.selected.Remove();
else if(myTree.selected.Children.Count() > 1)
myTree.selected.SetAttribute(STR_LABEL_ATTRIB, "Selected Files");
else
myTree.selected.SetAttribute(STR_LABEL_ATTRIB, "Selected File");
}
return true;
}
else
return false;
}
©c¡Ï ¤È¥¹ ©f¨u©c ©c¥ì ¥Î¤³ ©c/ ©¦£¯
©c¨Ê¥Î ¤´¥¨ ¥ó ¨× ¥ó¤á' ¥Ì©¦¥ /¤í ¥Õ©¦©f
¨Ö ¦á ©¦£þ ©` ¥Õ ©¦
©¦