private void ArrowLeft_MouseDown(object sender, MouseEventArgs e) { curFocusOn = FocusOn.ScrollBar; if (Value - SmallChange >= 0) { Value -= SmallChange; } }
private void ArrowRight_MouseDown(object sender, MouseEventArgs e) { curFocusOn = FocusOn.ScrollBar; if (Value + SmallChange <= MaxValue) { Value += SmallChange; } }
private void Thumb_MouseDown(object sender, MouseEventArgs e) { px = e.X; // 記住滑鼠點下時相對於元件的 (x,y) 坐標。 py = e.Y; isDragging = true; curScrollType = ScrollEventType.ThumbTrack; curFocusOn = FocusOn.ScrollBar; threadMoving = new Thread(MoveThumb); threadMoving.Start(); }
private void Thumb_MouseUp(object sender, MouseEventArgs e) { isDragging = false; curScrollType = ScrollEventType.EndScroll; curFocusOn = FocusOn.Input; threadMoving.Abort(); // scrollBar mouse up event ThumbMouseUp?.Invoke(this, e); }
// Update is called once per frame void Update() { Vector3 vec = transform.position; if (isZoomOut) { focus = Demo.FocusOn.FocusOnSelf; _camera.orthographicSize += Time.deltaTime; } if (isBossCamera) { focus = Demo.FocusOn.FocusOnBoss; if (_camera.orthographicSize < maxCameraSize) { _camera.orthographicSize += moveSpeed; } } //focus = Demo.FocusOn.FocusOnAn; switch (focus) { case Demo.FocusOn.FocusOnPankapu: //Debug.Log("Focus on pankapu."); FocusOn(pankapu, vec, pankapuMinX); break; case Demo.FocusOn.FocusOnAn: //Debug.Log("Focus on an."); FocusOn(an, vec, anMinX); break; case Demo.FocusOn.FocusOnPool: //Debug.Log("Focus on pankapu."); FocusOn(pool, vec, poolMinX); break; case Demo.FocusOn.FocusOnSelf: FocusAll(self, vec); break; case Demo.FocusOn.FocusOnBoss: CameraTranslate(bossPostion); break; } }
public SelectResult select(DataStoreHelper dsh, SelectMode selectMode, int date, List <IStrategy> strategyList, SelectHint hint = null) { bool bShowProgress = date == Utils.NowDate(); if (bShowProgress) { App.host_.uiStartProcessBar(); } SelectResult re = new SelectResult(); dsh.iSZIndex_ = App.ds_.index(App.ds_.szListData_, date); for (int isk = 0; isk < App.ds_.stockList_.Count; ++isk) { Stock sk = App.ds_.stockList_[isk]; if (bShowProgress) { App.host_.uiSetProcessBar(String.Format("正在检测是否选择{0}", sk.code_), isk * 100 / App.ds_.stockList_.Count); } int iDateIndexHint = -1; if (hint != null) { iDateIndexHint = hint.nextWantedIndexHintDict_[sk]; } dsh.setStock(sk); for (int i = 0; i < strategyList.Count; ++i) { IStrategy stra = strategyList[i]; Dictionary <String, String> rateItemDict = null; String sigInfo = ""; try { int iIndex = App.ds_.index(sk, date, iDateIndexHint); if (iIndex == -1) { continue; } if (hint != null) { hint.nextWantedIndexHintDict_[sk] = iIndex + 1; } dsh.iIndex_ = iIndex; if (dsh.dataList_[iIndex] == Data.NowInvalidData) { continue; } FocusOn fon = stra.focusOn(); int beforDateCount = sk.dataList_.Count - iIndex; bool isNewStock = beforDateCount < Setting.MyNewStockLimit; switch (fon) { case FocusOn.FO_Old: if (isNewStock) { continue; } break; case FocusOn.FO_All: break; case FocusOn.FO_New: if (!isNewStock) { continue; } break; default: throw new ArgumentException("Unknown focusOn"); } if (!isNewStock && dsh.MA(Info.A, 5, 1) < 20000) { continue; } rateItemDict = stra.select(dsh, selectMode, ref sigInfo); if (rateItemDict == null) { continue; } } catch (DataException /*ex*/) { continue; } SelectItem selItem = new SelectItem(); selItem.code_ = sk.code_; selItem.date_ = date; selItem.sigInfo_ = sigInfo; selItem.strategyName_ = stra.name(); selItem.rateItemDict_ = rateItemDict; re.selItems_.Add(selItem); } } Dictionary <String, int> strategySelCountDict = new Dictionary <String, int>(); foreach (var item in re.selItems_) { if (strategySelCountDict.ContainsKey(item.strategyName_)) { ++strategySelCountDict[item.strategyName_]; } else { strategySelCountDict.Add(item.strategyName_, 1); } } foreach (var item in re.selItems_) { item.sameDayStrategySelCount_ = strategySelCountDict[item.strategyName_]; item.sameDaySelCount_ = re.selItems_.Count; } if (bShowProgress) { App.host_.uiFinishProcessBar(); } return(re); }
private void ChangeFocusOn(FocusOn focus) { this.focus = focus; }
private void BindingTextBox_Enter(object sender, EventArgs e) { curFocusOn = FocusOn.Input; //showPlaceHolder = false; }