public void resetButton() { foreach (Button b in buttons) { b.Dispose(); } buttons.Clear(); buttonsLocationY = buttonStartY; //labels foreach (Label l in labels) { l.Dispose(); } labels.Clear(); //urls functionsURL.Clear(); int functionGroupNum = 0; int functionNum = 0; StringBuilder str = new StringBuilder(R7.STRING_SIZE); StringBuilder str2 = new StringBuilder(R7.STRING_SIZE); functionGroupNum = R8.GetFunctionGroupNum(); //20170124 leo: 加入 BrainVersion R7.GetVersion(str, R7.STRING_SIZE); //addLabel("version:" + str.ToString()); buttonsLocationY += 5; for (int i = 0; i < functionGroupNum; i++) { R8.GetFunctionGroupName(str, R7.STRING_SIZE, i); addLabel(str.ToString());//GroupName functionNum = R8.GetFunctionNumInGroup(i); for (int j = 0; j < functionNum; j++) { R8.GetFunctionName(str, R7.STRING_SIZE, i, j); R8.GetFunctionDoc(str2, R7.STRING_SIZE, i, j); //System.Console.WriteLine("getURL:" + str2); if (isInSearchMode) { if (str.ToString().ToLower().Contains(textBoxSearch.Text.ToLower())) { addButton(str.ToString(), str2.ToString()); } } else { addButton(str.ToString(), str2.ToString()); } } } str.Clear(); str2.Clear(); this.Text = str_Libraries + " " + buttons.Count + " of " + allFunctionCount; return; }
private void loadButtons() { allFunctionCount = 0; //addButton("OpenImage", "OpenImage"); //addButton("SaveImage", "SaveImage"); //addButton("DebugImage", "DebugImage"); //addButton("Binarize", "Binarize"); //20170123 leo : 改為從 function list 的 json 檔案 動態產生 buttonsLocationY = buttonStartY; int functionGroupNum = 0; int functionNum = 0; StringBuilder str = new StringBuilder(R7.STRING_SIZE); StringBuilder str2 = new StringBuilder(R7.STRING_SIZE); functionGroupNum = R8.GetFunctionGroupNum(); //20170124 leo: 加入 BrainVersion R7.GetVersion(str, R7.STRING_SIZE); //addLabel("version:" + str.ToString()); buttonsLocationY += 5; functionURL.Clear(); for (int i = 0; i < functionGroupNum; i++) { R8.GetFunctionGroupName(str, R7.STRING_SIZE, i); addLabel(str.ToString());//GroupName functionNum = R8.GetFunctionNumInGroup(i); for (int j = 0; j < functionNum; j++) { allFunctionCount++; R8.GetFunctionName(str, R7.STRING_SIZE, i, j); R8.GetFunctionDoc(str2, R7.STRING_SIZE, i, j); //System.Console.WriteLine("getURL:" + str2); addButton(str.ToString(), str2.ToString()); //20170603 leo: 增加 "如果 function 有說明 URL ,在右方 function 小視窗中的右下方顯示 help 按鈕。" //所以有url 連結的 name 要存起來 functionURL.Add(str.ToString(), str2.ToString()); } } str.Clear(); str2.Clear(); return; }