public CardView MakeCardForStory(PivotalStory story) { var card = new CardView { Type = story.Type.ToString().ToLower(), CurrentState = TranslateState(story.CurrentState), Size = story.Estimate, Title = story.Name, Owner = GetOwner(story), AvatarUrl = GetAvatarUrl(story), Url = story.Url, ProjectName = GetProjectName(story), Id = story.Id }; CardBadge badge; foreach(var item in story.Labels) { if(TryGetBadge(item, out badge)) card.AddBadge(badge); else card.AddLabel(item); } if(TryGetBadge("type:" + story.Type, out badge)) card.AddBadge(badge); foreach(var item in story.Tasks) card.AddTask(new CardTask { Name = item.Description, IsComplete = item.IsComplete, ImageUrl = item.IsComplete ? TaskCompleteUrl : TaskPendingUrl }); return card; }
public int GetCardViewRow(CardView cardView) { for (int i = 0; i < cardSlots.Count; i++) { if (cardSlots[i].card == cardView) { return i; } } return -1; }
public void AttachCard(CardView card) { card.Open(true); card.GetComponent<RectTransform>().SetParent(transform); card.GetComponent<RectTransform>().localPosition = Vector3.zero; card.GetComponent<RectTransform>().localRotation = Quaternion.identity; card.GetComponent<RectTransform>().localScale = Vector3.one; card.GetCardData().state = CardState.Arena; }
public UIView NextCardForCardView(CardView cardView) { var view = new UIView () { BackgroundColor = UIColor.FromRGB(r(), r(), r()), Frame = DemoCardView.Bounds }; view.Layer.ShouldRasterize = true; return view; }
public void OnPointerClick(PointerEventData eventData) { card.GetComponent<RectTransform>().SetParent(prevParent); card.transform.localPosition = Vector3.zero; card.transform.localRotation = prevRot; card.transform.localScale = Vector3.one; card.GetCardData().state = prevState; card = null; shadow.SetActive(false); }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Main); cardView = FindViewById<CardView> (Resource.Id.cardView); textView = FindViewById<TextView> (Resource.Id.infoText); textView.Text = "This is TextView\nInside of a CardView"; }
public void PickCard(CardView card) { if (card.GetCardData().state == CardState.Stacked && TurnManager.IsCardDrawn()) { return; }else{ card.GetComponent<RectTransform>().SetParent(container.transform); card.GetComponent<RectTransform>().localRotation = Quaternion.identity; card.GetComponent<RectTransform>().localScale = Vector3.one; card.GetComponent<CardView>().GetCardData().state = CardState.Handed; TurnManager.SetCardDrawn(); } }
public override void ViewDidLoad() { base.ViewDidLoad(); DemoCardView = new CardView (); DemoCardView.DidSwipeLeft += OnSwipe; DemoCardView.DidSwipeRight += OnSwipe; DemoCardView.DidCancelSwipe += OnSwipeCancelled; DemoCardView.DidStartSwipingCardAtLocation += OnSwipeStarted; DemoCardView.SwipingCardAtLocation += OnSwiping; DemoCardView.DidEndSwipingCard += OnSwipeEnded; View.BackgroundColor = UIColor.White; }
public void PreviewCard(CardView view) { shadow.SetActive(true); card = view; AudioSource.PlayClipAtPoint(audioClip, Vector3.zero); prevParent = card.transform.parent; prevState = card.GetCardData().state; card.GetCardData().state = CardState.Preview; card.GetComponent<RectTransform>().SetParent(transform); card.transform.localPosition = Vector3.zero; prevRot = card.transform.localRotation; card.transform.localRotation = Quaternion.identity; card.transform.localScale = Vector3.one; }
public override void OnViewCreated (View view, Bundle savedInstanceState) { base.OnViewCreated (view, savedInstanceState); cardView = (CardView)view.FindViewById<CardView> (Resource.Id.cardview); radiusSeekBar = (SeekBar)view.FindViewById (Resource.Id.cardview_radius_seekbar); radiusSeekBar.ProgressChanged += delegate { Log.Debug (TAG, string.Format ("SeekBar Radius progress : {0}", radiusSeekBar.Progress)); cardView.Radius = radiusSeekBar.Progress; }; elevationSeekBar = (SeekBar)view.FindViewById (Resource.Id.cardview_elevation_seekbar); elevationSeekBar.ProgressChanged+= delegate { Log.Debug(TAG,string.Format("SeekBar Elevation progress : {0}",elevationSeekBar.Progress)); cardView.Elevation = elevationSeekBar.Progress; }; }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); tinderView.BackgroundColor = UIColor.Clear; DemoCardView = new CardView(); //Wire up events DemoCardView.DidSwipeLeft += OnSwipe; DemoCardView.DidSwipeRight += OnSwipe; DemoCardView.DidCancelSwipe += OnSwipeCancelled; DemoCardView.DidStartSwipingCardAtLocation += OnSwipeStarted; DemoCardView.SwipingCardAtLocation += OnSwiping; DemoCardView.DidEndSwipingCard += OnSwipeEnded; ZeroControlsAlpha(); btnFinished.Frame = new CGRect(btnFinished.Frame.X, btnFinished.Frame.Y + btnFinished.Frame.Height, btnFinished.Frame.Width, btnFinished.Frame.Height); }
public static IHitReceiver GetTarget(CardView view) { if(Player.instance.playerPlayfield.GetCardViewRow(view) != -1){ var playerTarget = Enemy.instance.playerPlayfield.GetCardView(Player.instance.playerPlayfield.GetCardViewRow(view)); if(playerTarget!=null && playerTarget.GetComponent<IHitReceiver>()!=null){ return playerTarget.GetComponent<IHitReceiver>(); }else{ return Enemy.instance; } }else{ var enemyTarget = Player.instance.playerPlayfield.GetCardView(Enemy.instance.playerPlayfield.GetCardViewRow(view)); if(enemyTarget!=null && enemyTarget.GetComponent<IHitReceiver>()!=null){ return enemyTarget.GetComponent<IHitReceiver>(); }else{ return Player.instance; } } }
//Juega una carta y la elimina de la mano del jugador IEnumerator PlayCardViewer(IContainer game, GameAction action) { var playAction = action as PlayCardAction; CardView cardView = GetView(playAction.card); if (cardView == null) { yield break; } cards.Remove(cardView.transform); StartCoroutine(LayoutCards(true)); var discard = OverdrawCard(cardView.transform); while (discard.MoveNext()) { yield return(null); } }
/// <summary> /// 加载卡片 /// </summary> private void LoadCards() { //LocalUser.Instance.Camp = 2; if (LocalUser.Instance.Camp == (int)Camp.Dark) { int i = 1; GameObject[] _cards = GameObject.FindGameObjectsWithTag("CARD"); foreach (GameObject card in _cards) { CardView cardView = card.GetComponentInChildren <CardView>(); Card card_temp = null; if (cards.TryGetValue((SoldierEnum)i, out card_temp) == true) { cardView.role_name.text = card_temp.Name; cardView.role_img.sprite = card_temp.Img; cardView.role_energy.text = card_temp.Energy.ToString(); cardView.soldierType = card_temp.SoldierType; cardView.role_info_text.text = card_temp.Role_info.Replace('n', '\n'); } i++; } } if (LocalUser.Instance.Camp == (int)Camp.Bright) { int i = 6; GameObject[] _cards = GameObject.FindGameObjectsWithTag("CARD"); foreach (GameObject card in _cards) { CardView cardView = card.GetComponentInChildren <CardView>(); Card card_temp = null; if (cards.TryGetValue((SoldierEnum)i, out card_temp) == true) { cardView.role_name.text = card_temp.Name; cardView.role_img.sprite = card_temp.Img; cardView.role_energy.text = card_temp.Energy.ToString(); cardView.soldierType = card_temp.SoldierType; cardView.role_info_text.text = card_temp.Role_info.Replace('n', '\n'); } i++; } } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.cardview); imgview = FindViewById <ImageView>(Resource.Id.cardview_image); title = FindViewById <TextView>(Resource.Id.cardview_title); text = FindViewById <TextView>(Resource.Id.cardview_description); cardview = FindViewById <CardView>(Resource.Id.card); flayout = FindViewById <FrameLayout>(Resource.Id.framelayout); news = JsonConvert.DeserializeObject <News>(Intent.GetStringExtra("News")); Picasso.With(this).Load("http://www.segodnya.ua" + news.newsImgURL).Into(imgview); title.Text = news.newsTitle; title.TextSize = 25; text.Text = news.newsContent; text.TextSize = 16; flayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); cardview.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); }
protected override void InitializeViews() { closeButton = FindViewById(CloseButton); confirmButton = FindViewById <TextView>(ConfirmButton); descriptionEditText = FindViewById <EditText>(DescriptionEditText); singleTimeEntryModeViews = FindViewById <Group>(SingleTimeEntryModeViews); timeEntriesGroupModeViews = FindViewById <Group>(TimeEntriesGroupModeViews); stoppedTimeEntryStopTimeElements = FindViewById <Group>(StoppedTimeEntryStopTimeElements); billableRelatedViews = FindViewById <Group>(BillableRelatedViews); errorContainer = FindViewById <CardView>(ErrorContainer); errorText = FindViewById <TextView>(ErrorText); groupCountTextView = FindViewById <TextView>(GroupCount); groupDurationTextView = FindViewById <TextView>(GroupDuration); projectButton = FindViewById(SelectProjectButton); projectPlaceholderLabel = FindViewById <TextView>(ProjectPlaceholderLabel); projectTaskClientTextView = FindViewById <TextView>(ProjectTaskClient); tagsButton = FindViewById(SelectTagsButton); tagsRecycler = FindViewById <RecyclerView>(TagsRecyclerView); billableButton = FindViewById(ToggleBillableButton); billableSwitch = FindViewById <Switch>(BillableSwitch); startTimeTextView = FindViewById <TextView>(StartTime); startDateTextView = FindViewById <TextView>(StartDate); changeStartTimeButton = FindViewById(StartTimeButton); stopTimeTextView = FindViewById <TextView>(StopTime); stopDateTextView = FindViewById <TextView>(StopDate); changeStopTimeButton = FindViewById(StopTimeButton); stopTimeEntryButton = FindViewById(StopTimeEntryButtonLabel); durationTextView = FindViewById <TextView>(Duration); changeDurationButton = FindViewById(DurationButton); deleteLabel = FindViewById <TextView>(DeleteLabel); deleteButton = FindViewById(DeleteButton); }
public static CardView CreateCard(Card cardData) { CardView cardView = null; if (cardData is MagicCard) { cardView = Instantiate(instance.magicCardPrefab).GetComponent <MagicCardView>(); } else if (cardData is MonsterCard) { cardView = Instantiate(instance.monsterCardPrefab).GetComponent <MonsterCardView>(); } else if (cardData is EnvironmentCard) { cardView = Instantiate(instance.environmentCardPrefab).GetComponent <EnvironmentCardView>(); } cardView.Setup(cardData); return(cardView); }
public void SplitCards() { splitButton.gameObject.SetActive(false); int index = 0; foreach (KeyValuePair <int, CardView> item in fetchedCards) { index++; if (index == 1) { CardView cardObj = item.Value; ShowHandValue(); } else if (index == 2) { CardView cardObj = item.Value; } } }
protected override void OnCreate(Bundle savedInstanceState) { UserID = app.GetString("USERID", string.Empty); _lang = app.GetString("Language", "en"); ChangeLanguage(_lang); Fade slide = new Fade(FadingMode.In); Explode explode = new Explode(); Window.EnterTransition = slide; Window.ExitTransition = explode; // Create your application here base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.search_activity); mToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); mBottomNav = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation_view); mBottomCardView = FindViewById <CardView>(Resource.Id.bottom_cardview); mLoaderContent = FindViewById <RelativeLayout>(Resource.Id.relativeLayout); mBottomNav.SetOnNavigationItemSelectedListener(this); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); txtSearch = FindViewById <TextView>(Resource.Id.txtSearch); imgSearch = FindViewById <ImageView>(Resource.Id.imgSearchView); InitDecoration(); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.SetDisplayHomeAsUpEnabled(true); var hint = Resources.GetString(Resource.String.hint_search_in); SupportActionBar.Title = hint + " Wanunuzi"; SetUpRecyclerView(recyclerView); SearchOffset = string.Empty; search += ActivitySearch_search; progressBar.Visibility = ViewStates.Invisible; }
private void viewSamplesAttachmets_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Delete) { return; } CardView view = viewSamplesAttachmets as CardView; if (!(view.RowCount > 0 && view.FocusedRowHandle >= -1)) { return; } try { int sampleAttachmentID = (int)viewSamplesAttachmets.GetRowCellValue(view.FocusedRowHandle, "SampleAttachmentID"); SampleAttachments sampleAttachments = db.SampleAttachments.First(x => x.SampleAttachmentID == sampleAttachmentID); if ( MessageBox.Show( String.Format("Удалить документ \n{0}\nиз текущего образца?", sampleAttachments.FileName + sampleAttachments.FileExt), "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } db.SampleAttachments.RemoveRange(db.SampleAttachments.Where(x => x.SampleAttachmentID == sampleAttachmentID)); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } try { db.SaveChanges(); sampleAttachmentsBindingSource.DataSource = GetSamplesAttachmentsList(); // db.SampleAttachments.Where(x => x.SampleID == sampleID).ToList(); } catch (Exception ex) { Tools.showDbSaveExceptions(ex); } }
protected void LayoutWithEqualSpacing() { if (this.rectTransform.childCount == 0) { return; } // Position the cards. Order should be relative to our list and not to // whatever the current GameObject ordering is. float availableSpace = this.rectTransform.rect.width - padding * 2; float spaceRemaining = availableSpace; foreach (RectTransform transform in this.rectTransform) { spaceRemaining -= transform.rect.width; } // Calculate the spacing such that we try to preserve equal spacing // and overlapping when we run out of space. float deltaX; float x; if (spaceRemaining > 0) { deltaX = spaceRemaining / (this.rectTransform.childCount + 1f); x = padding + deltaX; } else { x = padding; deltaX = spaceRemaining / (this.rectTransform.childCount - 1f); } // Run through the cards in order and put them in place. foreach (RectTransform transform in this.rectTransform) { float y = (this.rectTransform.rect.height - transform.rect.height) / 2f; CardView view = transform.gameObject.GetComponent <CardView>(); transform.anchoredPosition = new Vector2(x, y); x += transform.rect.width + deltaX; } }
private void cardView1_DoubleClick(object sender, EventArgs e) { CardView view = (CardView)sender; Point pt = view.GridControl.PointToClient(Control.MousePosition); // DoRowDoubleClick(view, pt); CardHitInfo info = view.CalcHitInfo(pt); if (info.InCard) { int appid = (int)cardView1.GetRowCellValue(info.RowHandle, "ID"); var attachment = db.Attachments.First(x => x.ID == appid); Tools.openFilefromModel(new FileModel { Name = attachment.FileName, Extension = attachment.FileExt, Data = attachment.FileData }); } }
internal CardMenuPDVsModel GetItemPDV(CardView cardView, List <CardMenuPDVsModel> listCard) { var result = new CardMenuPDVsModel(); var relativa = (RelativeLayout)cardView.GetChildAt(0); result.name = ((TextView)relativa.GetChildAt(0)).Text; result.endereco = ((TextView)relativa.GetChildAt(1)).Text; foreach (CardMenuPDVsModel item in listCard) { if (item.name.Equals(result.name) && item.endereco.Equals(result.endereco)) { result.latitude = item.latitude; result.longitude = item.longitude; result.listTypePdv = item.listTypePdv; break; } } return(result); }
private void FnSetUpControls() { mToolbar = thisFragmentView.FindViewById <SupportToolbar>(Resource.Id.toolbarTitle); mRlContents = thisFragmentView.FindViewById <RelativeLayout>(Resource.Id.rlContents); mCardviewRunnerAppearance = thisFragmentView.FindViewById <CardView>(Resource.Id.cardviewCustomerAppearance); mTxtInputLayoutRunnerName = thisFragmentView.FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutCustomerName); mTxtInputLayoutMobileNumber = thisFragmentView.FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutMobileNumber); mTxtInputLayoutRunnerAddress = thisFragmentView.FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutCustomerAddress); mEtRunnerName = thisFragmentView.FindViewById <EditText>(Resource.Id.etCustomerName); mEtMobileNumber = thisFragmentView.FindViewById <EditText>(Resource.Id.etMobileNumber); mEtRunnerAddress = thisFragmentView.FindViewById <EditText>(Resource.Id.etCustomerAddress); mLlSaveButtonContainer = thisFragmentView.FindViewById <LinearLayout>(Resource.Id.llSaveButtonContainer); mBtnSaveRunner = thisFragmentView.FindViewById <Button>(Resource.Id.btnSaveCustomer); mToolbar.Visibility = ViewStates.Gone; mEtRunnerName.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(Runner_NAME_MAX_LENGTH) }); mEtMobileNumber.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(MOBILE_NUMBER_MAX_LENGTH) }); mEtRunnerAddress.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(ADDRESS_MAX_LENGTH) }); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.PaketlerDialogFragment, container, false); //view.FindViewById<RelativeLayout>(Resource.Id.rootView).ClipToOutline = true; DevamEt = view.FindViewById <Button>(Resource.Id.button1); DevamEt.Click += DevamEt_Click; PlusCard = view.FindViewById <CardView>(Resource.Id.card_view1); GoldCard = view.FindViewById <CardView>(Resource.Id.card_view2); PlatinumCard = view.FindViewById <CardView>(Resource.Id.card_view3); PlusCard.Tag = 0; GoldCard.Tag = 1; PlatinumCard.Tag = 2; PlusCard.Click += PlusCard_Click; GoldCard.Click += PlusCard_Click; PlatinumCard.Click += PlusCard_Click; MarginleriSifirla(1); return(view); }
private void Start() { cardView = GetComponent <CardView>(); RectTransform banner = cardView.nameText.transform.parent as RectTransform; Image img = banner.GetComponent <Image>(); if (img != null) { banner.GetComponent <Image>().color = bannerStartColor; } float textWidth = LayoutUtility.GetPreferredWidth(cardView.nameText.rectTransform); Rect bannerRect = banner.rect; if (textWidth < bannerRect.width) { banner.sizeDelta = new Vector2(textWidth, bannerRect.height); } }
public void DrawACard(bool normal = false) { deckCount = deck.Count; if (deck.Count > 0) { if (hand.Count < maxHand) { // 是否抽取普通卡 CardProto card = normal ? deck[0] : deck[Random.Range(0, deck.Count)]; Debug.Log(group + " 抽取一张卡片:" + card.GetName()); deck.Remove(card); CardView view = card.Create(group); view.handId = hand.Count; if (isSelf) { view.transform.SetParent(GameObject.Find("CardBattle/SelfHand").transform); } else { view.transform.SetParent(GameObject.Find("CardBattle/EnemyHand").transform); } // 缩放率为0.5 view.transform.localPosition = Vector3.zero; view.transform.localScale = new Vector3(0.5f, 0.5f); hand.Add(card); } else { EventManager.PostEvent(TipSystem.DataType.ShowTip, "手牌不得超过10张,请出牌后继续", isSelf ? true : false); //Debug.Log("手牌不得超过10张,请出牌后继续"); } } else { EventManager.PostEvent(TipSystem.DataType.ShowTip, "卡组没有可抽取的卡牌", isSelf ? true : false); } }
public override void OnBindViewHolder(Android.Support.V7.Widget.RecyclerView.ViewHolder holder, int position) { ViewHolder viewHolder = holder as ViewHolder; CardView cardView = viewHolder.CardView; ImageView mainImageView = cardView.FindViewById <ImageView>(Resource.Id.info_image); Drawable drawable = cardView.Resources.GetDrawable(imageIds[position]); mainImageView.SetImageDrawable(drawable); mainImageView.ContentDescription = captions[position]; TextView titleTextView = cardView.FindViewById <TextView>(Resource.Id.room_title_textview); titleTextView.Text = captions[position]; //ImageView iconImage = cardView.FindViewById<ImageView>(Resource.Id.info_icon); //iconImage.SetImageResource(Resource.Drawable.ic_edit); //iconImage.ContentDescription = captions[position]; //iconImage.RequestLayout(); //iconImage.LayoutParameters.Height = Convert.ToInt16(titleTextView.TextSize); //iconImage.SetColorFilter(new Android.Graphics.Color(context.GetColor(Resource.Color.colorAction))); TextView actionTextView1 = cardView.FindViewById <TextView>(Resource.Id.action1_textview); actionTextView1.Text = actionText[0]; actionTextView1.Click += Action1_Click; TextView actionTextView2 = cardView.FindViewById <TextView>(Resource.Id.action2_textview); actionTextView2.Text = actionText[1]; actionTextView2.Click += Action2_Click; View view = cardView.FindViewById <View>(Resource.Id.line_view); view.SetBackgroundColor(new Android.Graphics.Color(224, 224, 224)); TextView infoTextView = cardView.FindViewById <TextView>(Resource.Id.info_text); infoTextView.Text = context.GetString(Resource.String.info_text_for_room_title); infoTextView.SetTextColor(new Android.Graphics.Color(189, 189, 189)); }
protected async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); ideaTitleLbl = FindViewById <TextView>(Resource.Id.itemTitle); ideaDescriptionLbl = FindViewById <TextView>(Resource.Id.itemDescription); detailsView = FindViewById <LinearLayout>(Resource.Id.detailsView); addNoteFab = FindViewById <FloatingActionButton>(Resource.Id.addNotefab); var editNoteBtn = FindViewById <Button>(Resource.Id.editNoteBtn); noteCard = FindViewById <CardView>(Resource.Id.noteHolder); noteContentLbl = FindViewById <TextView>(Resource.Id.noteContent); addNoteFab.Click += AddNoteFab_Click; var swipeListener = new OnSwipeListener(this); swipeListener.OnSwipeRight += SwipeListener_OnSwipeRight; swipeListener.OnSwipeLeft += SwipeListener_OnSwipeLeft; ideaDescriptionLbl.SetOnTouchListener(swipeListener); detailsView.SetOnTouchListener(swipeListener); editNoteBtn.Click += delegate { var dialog = new AddNoteDialog(bookmarkedItems[Global.IdeaScrollPosition].Note); dialog.OnError += () => Snackbar.Make(addNoteFab, "Invalid note. Entry fields cannot be empty.", Snackbar.LengthLong).Show(); dialog.Show(FragmentManager, "ADDNOTEFRAG"); dialog.OnNoteSave += (Note note) => SaveNote(note); }; bookmarkedItems = await DBSerializer.DeserializeDBAsync <List <Idea> >(Global.BOOKMARKS_PATH); bookmarkedItems = bookmarkedItems ?? new List <Idea>(); bookmarkedIdea = bookmarkedItems[Global.BookmarkScrollPosition]; ideasList = Global.Categories.FirstOrDefault(x => x.CategoryLbl == bookmarkedIdea.Category).Items; notes = await DBSerializer.DeserializeDBAsync <List <Note> >(Global.NOTES_PATH); notes = notes ?? new List <Note>(); SetupUI(); }
private void InitView() { CardView card_share_view = FindViewById <CardView>(Resource.Id.card_share_view); RelativeLayout rela_round_big = FindViewById <RelativeLayout>(Resource.Id.rela_round_big); tv_share_view_tip = FindViewById <TextView>(Resource.Id.tv_share_view_tip); if (Intent != null) { int color = Intent.GetIntExtra("color", 0); if (color == 1) { rela_round_big.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(new Android.Graphics.Color(Utils.AppUtils.GetColor(this, Resource.Color.google_blue))); } else if (color == 2) { rela_round_big.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(new Android.Graphics.Color(Utils.AppUtils.GetColor(this, Resource.Color.google_green))); } else if (color == 3) { rela_round_big.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(new Android.Graphics.Color(Utils.AppUtils.GetColor(this, Resource.Color.google_yellow))); } else if (color == 4) { rela_round_big.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(new Android.Graphics.Color(Utils.AppUtils.GetColor(this, Resource.Color.google_red))); } else { rela_round_big.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(new Android.Graphics.Color(Utils.AppUtils.GetColor(this, Resource.Color.gray))); } card_share_view.SetOnTouchListener(this); AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f); alphaAnimation.Duration = 1500; alphaAnimation.StartOffset = 1000; alphaAnimation.SetAnimationListener(this); tv_share_view_tip.StartAnimation(alphaAnimation); } }
private void OnMainThread(IEnumerable <Card> cards) { foreach (var card in repo.GetMyCards()) { CardView cardView = new CardView { BindingContext = new CardViewModel(card) }; CardViews.Add(cardView); } if (CardViews.Count == 0) { return; } foreach (var child in CardViews) { view.Children.Add(child); } var button = new Button { Text = "Refresh", HorizontalOptions = LayoutOptions.CenterAndExpand }; button.Clicked += RefreshCards; view.Children.Add(new ContentPage { Content = new AbsoluteLayout { Children = { button } } }); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { NestedScrollView nestedScrollView = (NestedScrollView)inflater.Inflate(Resource.Layout.fragment_cards, container, false); btn_card_main1_action1 = nestedScrollView.FindViewById <Button>(Resource.Id.btn_card_main1_action1); btn_card_main1_action2 = nestedScrollView.FindViewById <Button>(Resource.Id.btn_card_main1_action2); img_main_card2_share = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card2_share); img_main_card2_bookmark = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card2_bookmark); img_main_card2_favorite = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card2_favorite); ll_card_main3_rate = nestedScrollView.FindViewById <LinearLayout>(Resource.Id.ll_card_main3_rate); img_main_card_1 = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_1); img_main_card_2 = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_2); img_card_main_3 = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_card_main_3); img_main_card_41 = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_41); img_main_card_42 = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card_42); img_main_card41_favorite = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card41_favorite); img_main_card42_favorite = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card42_favorite); img_main_card41_bookmark = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card41_bookmark); img_main_card42_bookmark = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card42_bookmark); img_main_card41_share = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card41_share); img_main_card42_share = nestedScrollView.FindViewById <ImageView>(Resource.Id.img_main_card42_share); card_main_1_1 = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_1); card_main_1_2 = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_2); card_main_1_3 = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_3); card_main_1_4_1 = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_4_1); card_main_1_4_2 = nestedScrollView.FindViewById <CardView>(Resource.Id.card_main_1_4_2); Glide.With(this).Load(Resource.Drawable.material_design_2).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_1); Glide.With(this).Load(Resource.Drawable.material_design_4).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_2); Glide.With(this).Load(Resource.Drawable.material_design_11).Apply(RequestOptions.FitCenterTransform()).Into(img_card_main_3); Glide.With(this).Load(Resource.Drawable.material_design_1).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_41); Glide.With(this).Load(Resource.Drawable.material_design_1).Apply(RequestOptions.FitCenterTransform()).Into(img_main_card_42); //ad_view = nestedScrollView.FindViewById(Resource.Id.ad_view); card_ad = nestedScrollView.FindViewById <CardView>(Resource.Id.card_ad); return(nestedScrollView); }
private void lvZone_SelectedIndexChanged(object sender, EventArgs e) { ListViewItem lvi = ((ListView)sender).FocusedItem; CardView cv = (CardView)ViewMap[CardMap[lvi]]; lblCardDetailID.Text = cv.ID.ToString(); lblCardDetailName.Text = cv.Name.ToString(); cbCardDetailCounters.Items.Clear(); cbCardDetailCounters.Items.AddRange(cv.Counters.ToArray()); tbCardDetailText.Text = cv.Text; if (cv.CardTypes.Contains("Creature")) { lblPowerToughness.Text = cv.Power.ToString() + "/" + cv.Toughness.ToString(); } else { lblPowerToughness.Text = ""; } }
public void SetLiLianList(List<ItemViewData> list, bool click = true) { while (table.transform.childCount > 0) { DestroyImmediate(table.transform.GetChild(0).gameObject); } for (int index = 0; index < list.Count; index++) { //设置格子 GameObject obj = Instantiate(prefab); CardView pop = obj.GetComponent<CardView>(); pop.InitData(list[index],click); pop.transform.parent = table.transform; pop.transform.localPosition = Vector3.zero; pop.transform.localScale = Vector3.one; pop.gameObject.SetActive(true); } table.Reposition(); scroll.ResetPosition(); table.repositionNow = true; }
private void gdvMaintenance_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e) { try { CardView view = (CardView)sender; if (view.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { MaintenanceObject maintenance = (MaintenanceObject)view.GetRow(view.FocusedRowHandle); if (maintenance != null) { maintenance.Material = MaterialMember; new BL.Internal.Maintenance().Save(maintenance); } } } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
private bool IsCardSelectable(GameObject cardGo) { var card = cardGo.GetComponent <GameObjectEntity>().Entity; CardView cardView = cardGo.GetComponent <CardView>(); var slotGo = cardView.Slot; var slot = slotGo.GetComponent <GameObjectEntity>().Entity; if (EntityManager.HasComponent <ShieldData>(card) && EntityManager.GetComponentData <SlotData>(slot).Type != SlotType.Deck && EntityManager.GetComponentData <SlotData>(slot).Type != SlotType.Bag) { return(false); } if (cardView.isDisabled) { return(false); } return(true); }
private void FnSetControls() { mRlContents = FindViewById <RelativeLayout>(Resource.Id.rlContents); mCardviewRunnerAppearance = FindViewById <CardView>(Resource.Id.cardviewCustomerAppearance); mTxtInputLayoutRunnerName = FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutCustomerName); mTxtInputLayoutMobileNumber = FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutMobileNumber); mTxtInputLayoutRunnerAddress = FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutCustomerAddress); mEtRunnerName = FindViewById <EditText>(Resource.Id.etCustomerName); mEtMobileNumber = FindViewById <EditText>(Resource.Id.etMobileNumber); mEtRunnerAddress = FindViewById <EditText>(Resource.Id.etCustomerAddress); mLlSaveButtonContainer = FindViewById <LinearLayout>(Resource.Id.llSaveButtonContainer); mBtnSaveRunner = FindViewById <Button>(Resource.Id.btnSaveCustomer); mEtRunnerName.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(Runner_NAME_MAX_LENGTH) }); mEtMobileNumber.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(MOBILE_NUMBER_MAX_LENGTH) }); mEtRunnerAddress.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(ADDRESS_MAX_LENGTH) }); mTxtInputLayoutRunnerName.Hint = "Runner name"; mBtnSaveRunner.Text = "SAVE RUNNER"; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Prepare view var view = inflater.Inflate(Resource.Layout.PickSyllable, container, false); tvPickSyllable = view.FindViewById <TextView>(Resource.Id.tvPickSyllable); llLayout = view.FindViewById <LinearLayout>(Resource.Id.llLayout); llLayout.Drag += textViewDragZoneDrag; llTaskItems = view.FindViewById <LinearLayout>(Resource.Id.pickSyllableTaskItems); ivDropZone = view.FindViewById <ImageView>(Resource.Id.ivPickSyllableDropZone); cvDropZone = view.FindViewById <CardView>(Resource.Id.cardView); emptyDropZoneImage = BitmapFactory.DecodeResource(Activity.BaseContext.Resources, Resource.Drawable.ic_help_black_24dp); volumeUpDropZoneImage = BitmapFactory.DecodeResource(Activity.BaseContext.Resources, Resource.Drawable.ic_volume_up_black_24dp); InitIteration(); return(view); }
public CardEditModel(CardView card, List <CardSet> cardSets, List <ModifierType> cardModifiers) { CardSetOptions = new List <SelectListItem>(); CardModifierOptions = new List <SelectListItem>(); Card = card; foreach (var set in cardSets) { CardSetOptions.Add(new SelectListItem { Text = set.CardSetName, Value = set.CardSetID.ToString() }); } foreach (var mod in cardModifiers) { CardModifierOptions.Add(new SelectListItem { Text = mod.ModifierTypeName, Value = mod.ModifierTypeID.ToString() }); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Editprofile); var toolbareditprofile = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarEditProfile); SetSupportActionBar(toolbareditprofile); MaterialMenuDrawable materialMenu = new MaterialMenuDrawable(this, Color.Purple, (int)stroke.EXTRA_THIN, MaterialMenuDrawable.DefaultScale, MaterialMenuDrawable.DefaultTransformDuration); materialMenu.SetIconState(MaterialMenuDrawable.IconState.Arrow); toolbareditprofile.NavigationIcon = materialMenu; toolbareditprofile.NavigationClick += delegate { OnBackPressed(); Finish(); }; editname = FindViewById <EditText>(Resource.Id.editname); edittitle = FindViewById <EditText>(Resource.Id.edittitle); editemail = FindViewById <TextView>(Resource.Id.editEmail); editstaffid = FindViewById <TextView>(Resource.Id.editStaffID); editcollege = FindViewById <TextView>(Resource.Id.editCollege); editdepartment = FindViewById <TextView>(Resource.Id.editDepartment); editHolder = FindViewById <CardView>(Resource.Id.editCard); editpgb = FindViewById <ProgressBar>(Resource.Id.editprofilepgb); edittextEdit = FindViewById <TextView>(Resource.Id.editprofileEdit); auth = FirebaseAuth.Instance; curruser = "******"" + auth.CurrentUser.Email.ToString() + "\""; new GetProfileSpecifictDataEdit(this).Execute(Common.getAddresApiProfilespecifictitle(curruser)); edittextEdit.Click += delegate { new EditProfileData(profileList[0], editname.Text.ToString(), edittitle.Text.ToString(), this).Execute(Common.getAddressSingleProfile(profileList[0])); StartActivity(typeof(SettingsActivity)); Finish(); }; // Create your application here }
private void InstantiateStockPile(Stack <Card> stockPileCards, Vector2 suggestedCardSize, float y_padding_worldSpace) { this.stockPile_pos = tableuPositions.Last() + new Vector3(0, y_padding_worldSpace + suggestedCardSize.y, 0); Card[] stockPileCardsArr = stockPileCards.ToArray(); CardView previousCardView = null; for (int i = 0; i < stockPileCards.Count; i++) { Card stockPileCard = stockPileCardsArr[i]; GameObject stockPileGO = this.InstantiateCardGameObject(suggestedCardSize, stockPile_pos, false, stockPileCard, i); CardView stockPileCardView = stockPileGO.GetComponent <CardView>(); previousCardView = stockPileCardView; stockPileGO.name = stockPileCard.ToString() + "(Stock)"; } //Initialize Object to decect stock touches GameObject stockPileClickDetectorGO = new GameObject("stockPileClickDetectorGO"); stockPileClickDetectorGO.transform.parent = cardsContainer; var stockClickDetector = stockPileClickDetectorGO.AddComponent <StockClickDetector>(); stockClickDetector.cooldown = flipSpeed; stockPileClickDetectorGO.AddComponentCopy(previousCardView.GetComponent <BoxCollider2D>()); stockPileClickDetectorGO.transform.localScale = previousCardView.transform.localScale; stockPileClickDetectorGO.transform.position = previousCardView.transform.position; //Make sure it's above everything else so it catches the raycastings first. stockPileClickDetectorGO.transform.SetZ(-52); //Make fondo of stock object var go = InstantiateAndScale(foundationPilePrefab, suggestedCardSize, stockPile_pos); go.GetComponent <CardView>().bigSuit.enabled = false; go.transform.SetZ(1); go.name = "Stock_Fondo"; go.transform.parent = cardsContainer; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _disposed = true; _searchHandlerAppearanceTracker?.Dispose(); SearchHandler.PropertyChanged -= OnSearchHandlerPropertyChanged; _textBlock.ItemClick -= OnTextBlockItemClicked; _textBlock.RemoveTextChangedListener(this); _textBlock.SetOnEditorActionListener(null); _textBlock.Adapter.Dispose(); _textBlock.Adapter = null; _textBlock.DropDownBackground.Dispose(); _textBlock.SetDropDownBackgroundDrawable(null); _clearButton.Click -= OnClearButtonClicked; _clearPlaceholderButton.Click -= OnClearPlaceholderButtonClicked; _searchButton.Click -= OnSearchButtonClicked; _textBlock.Dispose(); _clearButton.Dispose(); _searchButton.Dispose(); _cardView.Dispose(); _clearPlaceholderButton.Dispose(); } _textBlock = null; _clearButton = null; _searchButton = null; _cardView = null; _clearPlaceholderButton = null; _shellContext = null; _searchHandlerAppearanceTracker = null; SearchHandler = null; }
public UIView NextCardForCardView(CardView cardView) { var view = new UIView { BackgroundColor = UIColor.FromRGBA(r(), r(), r(), (byte) 255), Frame = DemoCardView.Bounds }; view.Layer.EdgeAntialiasingMask = CAEdgeAntialiasingMask.All; view.Layer.ShadowColor = UIColor.Black.CGColor; view.Layer.ShadowOffset = new CGSize (0f, 1.5f); view.Layer.ShouldRasterize = true; view.Layer.ShadowOpacity = 0.33f; view.Layer.ShadowRadius = 4.0f; view.Layer.CornerRadius = 6.0f; var label = new UILabel { Font = UIFont.FromName(UIFont.FontNamesForFamilyName("Marion") [0], 22f), Bounds = new CGRect (0f, 0f, view.Frame.Width - 50f, view.Frame.Height - 100f), Text = quotes.Count > 0 ? quotes.ElementAt(random.Next(0, quotes.Count - 1)) : "Be Happy :)", LineBreakMode = UILineBreakMode.WordWrap, BackgroundColor = UIColor.Clear, TextColor = UIColor.White, Center = view.Center, Lines = 0 }; view.AddSubview(label); label.SizeToFit(); label.Center = view.Center; return view; }
bool IsSelected(CardView view) { return view.GetComponent<Toggle>().isOn; }
void ApplyView(CardView view, CardPool.CardContext cx) { view.title.text = cx.title; view.image.sprite = cx.image; view.description.text = cx.description; }
private void btnPhieuDaTra_Click(object sender, EventArgs e) { groupControl1.Text = "Danh sách phiếu mượn đã trả sách"; gridCPhieuMuonDaTra.Visible = true; gridCPhieuMuonChuaTra.Visible = false; gridCSachQuaHan.Visible = false; DataSet setDaTra = new DataSet(); DataTable dtPSDaTra = psBLL.QuanLyMuonTra_LoadPhieuSachDaTra(); DataTable dtSDaTra = psBLL.QuanLyMuonTra_LoadSachDaTra(); if (dtPSDaTra.Rows.Count != 0 && dtSDaTra.Rows.Count != 0) { setDaTra.Tables.Add(dtPSDaTra); setDaTra.Tables.Add(dtSDaTra); setDaTra.Tables[0].TableName = "LoadPhieuSachDaTra"; setDaTra.Tables[1].TableName = "LoadSachDaTra"; DataColumn key = setDaTra.Tables["LoadPhieuSachDaTra"].Columns["MaPhieu"]; DataColumn fkey = setDaTra.Tables["LoadSachDaTra"].Columns["MaPhieu"]; DataRelation DRDaTra = new DataRelation("Chi Tiết Phiếu", key, fkey, true); setDaTra.Relations.Add(DRDaTra); gridCPhieuMuonDaTra.DataSource = setDaTra.Tables[0]; gridCPhieuMuonDaTra.ForceInitialize(); CardView cardView2 = new CardView(gridCPhieuMuonDaTra); gridCPhieuMuonDaTra.LevelTree.Nodes.Add("Chi Tiết Phiếu", cardView2); cardView1.ViewCaption = "Chi Tiết Phiếu Sách"; grdPhieuMuonDaTra.Columns["MaPhieu"].VisibleIndex = 0; cardView2.PopulateColumns(setDaTra.Tables[1]); grdPhieuMuonDaTra.OptionsBehavior.Editable = false; cardView2.Columns["MaPhieu"].VisibleIndex = 1; } }
private GameObject createText(GameObject parent, Font font, string name, int fontSize, float characterSize, Vector3 scale, CardView cv) { if (sttngs.usedLanguage == Language.RU) { fontSize = (int)(fontSize * 0.725); } if (sttngs.usedFont == -1 && sttngs.usedLanguage == Language.RU) { font = (Font)ResourceManager.Load("Fonts/arial"); } if (sttngs.usedFont == 1) { font = (Font)ResourceManager.Load("Fonts/arial"); } else { if (sttngs.usedFont == 2) { font = (Font)ResourceManager.Load("Fonts/HoneyMeadBB_bold"); } else { if (sttngs.usedFont == 3) { font = (Font)ResourceManager.Load("Fonts/HoneyMeadBB_boldital"); } else { if (sttngs.usedFont == 4) { font = (Font)ResourceManager.Load("Fonts/dwarvenaxebb"); } } } } GameObject gameObject = new GameObject("TextMesh"); MeshRenderer meshRenderer = gameObject.AddComponent<MeshRenderer>(); TextMesh textMesh = gameObject.AddComponent<TextMesh>(); textMesh.font = font; textMesh.fontSize = fontSize; textMesh.characterSize = characterSize; textMesh.lineSpacing = 0.85f; gameObject.name = name; font.material.color = Color.black; meshRenderer.material = font.material; meshRenderer.material.shader = ResourceManager.LoadShader("Scrolls/GUI/3DTextShader");//CardView.fontShader //this.renderQueueOffsets.Add(meshRenderer, -4); ((Dictionary<Renderer, int>)this.renderQueueOffsetsfield.GetValue(cv)).Add(meshRenderer, -4); UnityUtil.addChild(parent, gameObject); gameObject.transform.localScale = scale; gameObject.transform.localEulerAngles = new Vector3(90f, 90f, 270f); gameObject.renderer.material.color = new Color(0.23f, 0.16f, 0.125f); return gameObject; }
/// <summary> /// Handler for MouseMove events related to this CardItem. /// Called from CardCanvas. /// </summary> /// <param name="e">Not used</param> public void MoveMouse(CardView view, MouseEventArgs e) { if(ItemData.IsSelected) { if(IsLeftMouseButtonDown) { HandleMouseMoveWithLeftMouseButtonDown(view, e); } else { HandleMouseMoveWithLeftMouseButtonUp(view, e); } } else { // not selected so highlight the CardItem. if(!ItemData.IsHighlighted) { ItemData.QslCard.ClearHighlighted(); ItemData.IsHighlighted = true; } } }
private void btnPhieuChuaTra_Click(object sender, EventArgs e) { groupControl1.Text = "Danh sách phiếu mượn chưa trả sách"; gridCPhieuMuonDaTra.Visible = false; gridCPhieuMuonChuaTra.Visible = true; gridCSachQuaHan.Visible = false; DataSet set = new DataSet(); DataTable dtPS = psBLL.QuanLyMuonTra_LoadPhieuSachChuaTra(); DataTable dtS = psBLL.QuanLyMuonTra_LoadSachChuaTra(); if (dtPS.Rows.Count != 0 && dtS.Rows.Count != 0) { set.Tables.Add(dtPS); set.Tables.Add(dtS); set.Tables[0].TableName = "LoadPhieuSach"; set.Tables[1].TableName = "LoadSach"; DataColumn k = set.Tables["LoadPhieuSach"].Columns["MaPhieu"]; DataColumn kt = set.Tables["LoadSach"].Columns["MaPhieu"]; DataRelation RE = new DataRelation("Chi Tiết Phiếu", k, kt, true); set.Relations.Add(RE); gridCPhieuMuonChuaTra.DataSource = set.Tables["LoadPhieuSach"]; gridCPhieuMuonChuaTra.ForceInitialize(); CardView cardView1 = new CardView(gridCPhieuMuonChuaTra); gridCPhieuMuonChuaTra.LevelTree.Nodes.Add("Chi Tiết Phiếu", cardView1); cardView1.ViewCaption = "Chi tiết Phiếu sách"; grdPhieuMuonChuaTra.Columns["MaPhieu"].VisibleIndex = 0; cardView1.PopulateColumns(dtS); grdPhieuMuonChuaTra.OptionsBehavior.Editable = false; cardView1.Columns["MaPhieu"].VisibleIndex = 1; } }
public static void Engrave(CardView card) { card.GetCardData().state = CardState.Dead; instance.graveyard.Drop(card); }
public UIView NextCardForCardView(CardView cardView) { if (progressCount > Beers.Count || progressCount == Beers.Count) { var errorView = new UIView { BackgroundColor = UIColor.Clear, Frame = DemoCardView.Bounds }; var bgd = new UIView { BackgroundColor = UIColor.FromRGB(255,125,141), Frame = DemoCardView.Bounds }; bgd.Layer.CornerRadius = 4; bgd.Layer.ShadowColor = UIColor.Black.CGColor; bgd.Layer.ShadowOpacity = 0.2f; bgd.Layer.ShadowOffset = new CGSize(0, 0); bgd.Layer.ShouldRasterize = true; errorView.AddSubview(bgd); var errorLabel = new UILabel(new CGRect(20, 10, DemoCardView.Bounds.Width - 40, DemoCardView.Bounds.Height)); errorLabel.Text = "Thats all 100 popular beers \nfor your current location!"; errorLabel.Lines = 2; errorLabel.TextColor = UIColor.White; errorLabel.Font = UIFont.FromName("Avenir-Medium", 20.0f); errorLabel.TextAlignment = UITextAlignment.Center; errorLabel.TextAlignment = UITextAlignment.Center; errorView.AddSubview(errorLabel); return errorView; } var beerView = new UIView { BackgroundColor = UIColor.Clear, Frame = DemoCardView.Bounds }; //Create a card with a random background color var card = new UIView { BackgroundColor = UIColor.White, Frame = DemoCardView.Bounds }; //var cv = new CustomControls.TinderBox(new IntPtr(), "beername"); //cv.Frame = card.Bounds; //card.AddSubview(cv); //Rasterize card for more efficient animation card.Layer.CornerRadius = 4; card.Layer.ShadowColor = UIColor.Black.CGColor; card.Layer.ShadowOpacity = 0.5f; card.Layer.ShadowOffset = new CGSize(0, 0); card.Layer.ShouldRasterize = true; beerView.AddSubview(card); var label = new UILabel(new CGRect(20, 10, card.Frame.Width - 40, 30)); label.Text = "Duvel"; label.TextColor = UIColor.FromRGB(104, 104, 104); label.Font = UIFont.FromName("Avenir-Medium", 24.0f); label.TextAlignment = UITextAlignment.Center; beerView.AddSubview(label); var btnNope = new UIButton(UIButtonType.RoundedRect); btnNope.SetTitle("Nope", UIControlState.Normal); btnNope.Font = UIFont.FromName("Avenir-Medium", 30.0f); btnNope.SetTitleColor(UIColor.FromRGB(255,125,141), UIControlState.Normal); btnNope.Frame = new CGRect(20, card.Frame.Height - 45, card.Frame.Width /2 -10, 30); btnNope.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; btnNope.TouchUpInside += delegate { DemoCardView.SwipeTopCardToLeft(); }; beerView.Add(btnNope); var btnYes = new UIButton(UIButtonType.RoundedRect); btnYes.SetTitle("Yep", UIControlState.Normal); btnYes.Font = UIFont.FromName("Avenir-Medium", 30.0f); btnYes.SetTitleColor(UIColor.FromRGB(80,210,194), UIControlState.Normal); btnYes.Frame = new CGRect(10 + card.Frame.Width /2, card.Frame.Height - 45, card.Frame.Width /2 - 20, 30); btnYes.HorizontalAlignment = UIControlContentHorizontalAlignment.Right; btnYes.TouchUpInside += delegate { DemoCardView.SwipeTopCardToRight(); }; beerView.Add(btnYes); return beerView; }
/// <summary> /// Handle MouseLeftButtonDown event /// </summary> /// <param name="view">CardView object that contains this CardItemView</param> /// <param name="e">MouseButtonEventArgs object</param> // Must be public because called from CardCanvas public void OnMouseLeftButtonDown(CardView view, MouseButtonEventArgs e) { Point pt = e.GetPosition(view); if(GetCursorLocation(pt.X, pt.Y) != CursorLocation.Outside) { IsLeftMouseButtonDown = true; originalDisplayRectangle = new Rect(ItemData.DisplayX, ItemData.DisplayY, ItemData.DisplayWidth, ItemData.DisplayHeight); leftMouseDownPoint = e.GetPosition(view); } e.Handled = true; }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(DlgSupcomMapOptions)); this.gpgMapSelectGrid = new GPGChatGrid(); this.cardView1 = new CardView(); this.colMapTitle = new GridColumn(); this.colStatus = new GridColumn(); this.riPriority = new RepositoryItemImageComboBox(); this.ilThumbs = new ImageList(this.components); this.colMap = new GridColumn(); this.riMap = new RepositoryItemPictureEdit(); this.rimPictureEdit3 = new RepositoryItemPictureEdit(); this.rimTextEdit = new RepositoryItemTextEdit(); this.rimMemoEdit3 = new RepositoryItemMemoEdit(); this.riPopup = new RepositoryItemPopupContainerEdit(); this.repositoryItemTimeEdit1 = new RepositoryItemTimeEdit(); this.repositoryItemTextEdit1 = new RepositoryItemTextEdit(); this.riPictureStatus = new RepositoryItemPictureEdit(); this.riButtonStatus = new RepositoryItemButtonEdit(); this.riTextPriority = new RepositoryItemTextEdit(); this.colTime = new GridColumn(); this.colType = new GridColumn(); this.colDescription = new GridColumn(); this.colData = new GridColumn(); this.rbAeon = new RadioButton(); this.rbCybran = new RadioButton(); this.rbUEF = new RadioButton(); this.rbRandom = new RadioButton(); this.lMapPrefs = new GPGLabel(); this.gpgLabel1 = new GPGLabel(); this.skinButtonCancel = new SkinButton(); this.skinButtonSearch = new SkinButton(); this.rbSeraphim = new RadioButton(); ((ISupportInitialize) base.pbBottom).BeginInit(); this.gpgMapSelectGrid.BeginInit(); this.cardView1.BeginInit(); this.riPriority.BeginInit(); this.riMap.BeginInit(); this.rimPictureEdit3.BeginInit(); this.rimTextEdit.BeginInit(); this.rimMemoEdit3.BeginInit(); this.riPopup.BeginInit(); this.repositoryItemTimeEdit1.BeginInit(); this.repositoryItemTextEdit1.BeginInit(); this.riPictureStatus.BeginInit(); this.riButtonStatus.BeginInit(); this.riTextPriority.BeginInit(); base.SuspendLayout(); base.pbBottom.Size = new Size(0x3c5, 0x39); base.ttDefault.SetSuperTip(base.pbBottom, null); base.ttDefault.DefaultController.AutoPopDelay = 0x3e8; base.ttDefault.DefaultController.ToolTipLocation = ToolTipLocation.RightTop; this.gpgMapSelectGrid.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.gpgMapSelectGrid.CustomizeStyle = false; this.gpgMapSelectGrid.EmbeddedNavigator.Name = ""; this.gpgMapSelectGrid.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.gpgMapSelectGrid.IgnoreMouseWheel = false; this.gpgMapSelectGrid.Location = new Point(12, 0x55); this.gpgMapSelectGrid.LookAndFeel.SkinName = "Money Twins"; this.gpgMapSelectGrid.LookAndFeel.Style = LookAndFeelStyle.Office2003; this.gpgMapSelectGrid.LookAndFeel.UseDefaultLookAndFeel = false; this.gpgMapSelectGrid.MainView = this.cardView1; this.gpgMapSelectGrid.Name = "gpgMapSelectGrid"; this.gpgMapSelectGrid.RepositoryItems.AddRange(new RepositoryItem[] { this.rimPictureEdit3, this.rimTextEdit, this.rimMemoEdit3, this.riPopup, this.repositoryItemTimeEdit1, this.riPriority, this.riMap, this.repositoryItemTextEdit1, this.riPictureStatus, this.riButtonStatus, this.riTextPriority }); this.gpgMapSelectGrid.ShowOnlyPredefinedDetails = true; this.gpgMapSelectGrid.Size = new Size(0x3e8, 0x12b); this.gpgMapSelectGrid.TabIndex = 0x1d; this.gpgMapSelectGrid.ViewCollection.AddRange(new BaseView[] { this.cardView1 }); this.cardView1.Appearance.Card.BackColor = Color.Black; this.cardView1.Appearance.Card.ForeColor = Color.White; this.cardView1.Appearance.Card.Options.UseBackColor = true; this.cardView1.Appearance.Card.Options.UseForeColor = true; this.cardView1.Appearance.EmptySpace.BackColor = Color.Black; this.cardView1.Appearance.EmptySpace.Options.UseBackColor = true; this.cardView1.Appearance.FieldCaption.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.cardView1.Appearance.FieldCaption.ForeColor = Color.FromArgb(0x8f, 0xbd, 0xd1); this.cardView1.Appearance.FieldCaption.Options.UseFont = true; this.cardView1.Appearance.FieldCaption.Options.UseForeColor = true; this.cardView1.Appearance.FieldValue.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.cardView1.Appearance.FieldValue.ForeColor = Color.White; this.cardView1.Appearance.FieldValue.Options.UseFont = true; this.cardView1.Appearance.FieldValue.Options.UseForeColor = true; this.cardView1.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xd4, 0xd0, 200); this.cardView1.Appearance.FilterCloseButton.BackColor2 = Color.FromArgb(90, 90, 90); this.cardView1.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xd4, 0xd0, 200); this.cardView1.Appearance.FilterCloseButton.ForeColor = Color.Black; this.cardView1.Appearance.FilterCloseButton.GradientMode = LinearGradientMode.ForwardDiagonal; this.cardView1.Appearance.FilterCloseButton.Options.UseBackColor = true; this.cardView1.Appearance.FilterCloseButton.Options.UseBorderColor = true; this.cardView1.Appearance.FilterCloseButton.Options.UseForeColor = true; this.cardView1.Appearance.FilterPanel.BackColor = Color.Black; this.cardView1.Appearance.FilterPanel.BackColor2 = Color.FromArgb(0xd4, 0xd0, 200); this.cardView1.Appearance.FilterPanel.ForeColor = Color.White; this.cardView1.Appearance.FilterPanel.GradientMode = LinearGradientMode.ForwardDiagonal; this.cardView1.Appearance.FilterPanel.Options.UseBackColor = true; this.cardView1.Appearance.FilterPanel.Options.UseForeColor = true; this.cardView1.Appearance.SeparatorLine.BackColor = Color.Black; this.cardView1.Appearance.SeparatorLine.Options.UseBackColor = true; this.cardView1.BorderStyle = BorderStyles.NoBorder; this.cardView1.Columns.AddRange(new GridColumn[] { this.colMapTitle, this.colStatus, this.colMap }); this.cardView1.DetailHeight = 400; this.cardView1.FocusedCardTopFieldIndex = 0; this.cardView1.GridControl = this.gpgMapSelectGrid; this.cardView1.Name = "cardView1"; this.cardView1.OptionsBehavior.AllowExpandCollapse = false; this.cardView1.OptionsBehavior.AutoPopulateColumns = false; this.cardView1.OptionsBehavior.FieldAutoHeight = true; this.cardView1.OptionsBehavior.Sizeable = false; this.cardView1.OptionsSelection.MultiSelect = true; this.cardView1.OptionsView.ShowCardCaption = false; this.cardView1.OptionsView.ShowFieldCaptions = false; this.cardView1.OptionsView.ShowQuickCustomizeButton = false; this.cardView1.VertScrollVisibility = ScrollVisibility.Auto; this.cardView1.CustomDrawCardField += new RowCellCustomDrawEventHandler(this.cardView1_CustomDrawCardField); this.cardView1.Click += new EventHandler(this.cardView1_Click); this.colMapTitle.AppearanceCell.BackColor = Color.FromArgb(0x1b, 0x2e, 0x4a); this.colMapTitle.AppearanceCell.BackColor2 = Color.FromArgb(12, 0x17, 0x29); this.colMapTitle.AppearanceCell.Font = new Font("Arial", 10f, FontStyle.Bold, GraphicsUnit.Point, 0); this.colMapTitle.AppearanceCell.ForeColor = Color.FromArgb(0x8f, 0xbd, 0xd1); this.colMapTitle.AppearanceCell.GradientMode = LinearGradientMode.ForwardDiagonal; this.colMapTitle.AppearanceCell.Options.UseBackColor = true; this.colMapTitle.AppearanceCell.Options.UseFont = true; this.colMapTitle.AppearanceCell.Options.UseForeColor = true; this.colMapTitle.AppearanceCell.Options.UseTextOptions = true; this.colMapTitle.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center; this.colMapTitle.AppearanceCell.TextOptions.Trimming = Trimming.None; this.colMapTitle.AppearanceCell.TextOptions.VAlignment = VertAlignment.Top; this.colMapTitle.AppearanceHeader.Font = new Font("Arial", 12f, FontStyle.Bold, GraphicsUnit.Point, 0); this.colMapTitle.AppearanceHeader.Options.UseFont = true; this.colMapTitle.Caption = "Map Name"; this.colMapTitle.FieldName = "Description"; this.colMapTitle.Name = "colMapTitle"; this.colMapTitle.OptionsColumn.AllowEdit = false; this.colMapTitle.Visible = true; this.colMapTitle.VisibleIndex = 0; this.colStatus.AppearanceCell.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.colStatus.AppearanceCell.Options.UseFont = true; this.colStatus.AppearanceCell.Options.UseTextOptions = true; this.colStatus.AppearanceCell.TextOptions.Trimming = Trimming.None; this.colStatus.AppearanceCell.TextOptions.VAlignment = VertAlignment.Center; this.colStatus.Caption = "Priority"; this.colStatus.ColumnEdit = this.riPriority; this.colStatus.FieldName = "Priority"; this.colStatus.Name = "colStatus"; this.colStatus.OptionsColumn.AllowEdit = false; this.colStatus.OptionsColumn.AllowFocus = false; this.colStatus.OptionsColumn.ReadOnly = true; this.colStatus.ShowButtonMode = ShowButtonModeEnum.ShowOnlyInEditor; this.colStatus.Visible = true; this.colStatus.VisibleIndex = 1; this.riPriority.AllowNullInput = DefaultBoolean.True; this.riPriority.Appearance.BackColor = Color.Black; this.riPriority.Appearance.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.riPriority.Appearance.ForeColor = Color.White; this.riPriority.Appearance.Options.UseBackColor = true; this.riPriority.Appearance.Options.UseFont = true; this.riPriority.Appearance.Options.UseForeColor = true; this.riPriority.AppearanceDropDown.BackColor = Color.Black; this.riPriority.AppearanceDropDown.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.riPriority.AppearanceDropDown.ForeColor = Color.White; this.riPriority.AppearanceDropDown.Options.UseBackColor = true; this.riPriority.AppearanceDropDown.Options.UseFont = true; this.riPriority.AppearanceDropDown.Options.UseForeColor = true; this.riPriority.AutoHeight = false; this.riPriority.DropDownRows = 3; this.riPriority.HideSelection = false; this.riPriority.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("<LOC>Neutral", null, 0), new ImageComboBoxItem("<LOC>Thumbs Up", true, 1), new ImageComboBoxItem("<LOC>Thumbs Down", false, 2) }); this.riPriority.LargeImages = this.ilThumbs; this.riPriority.Name = "riPriority"; this.riPriority.Validating += new CancelEventHandler(this.riPriority_Validating); this.ilThumbs.ImageStream = (ImageListStreamer) manager.GetObject("ilThumbs.ImageStream"); this.ilThumbs.TransparentColor = Color.Transparent; this.ilThumbs.Images.SetKeyName(0, "neutral.png"); this.ilThumbs.Images.SetKeyName(1, "thumbsup.png"); this.ilThumbs.Images.SetKeyName(2, "thumbsdown.png"); this.colMap.Caption = "Image"; this.colMap.ColumnEdit = this.riMap; this.colMap.FieldName = "Thumbnail"; this.colMap.Name = "colMap"; this.colMap.OptionsColumn.AllowEdit = false; this.colMap.Visible = true; this.colMap.VisibleIndex = 2; this.riMap.CustomHeight = 200; this.riMap.Name = "riMap"; this.riMap.SizeMode = PictureSizeMode.Stretch; this.rimPictureEdit3.Name = "rimPictureEdit3"; this.rimPictureEdit3.PictureAlignment = ContentAlignment.TopCenter; this.rimTextEdit.AutoHeight = false; this.rimTextEdit.Name = "rimTextEdit"; this.rimMemoEdit3.MaxLength = 500; this.rimMemoEdit3.Name = "rimMemoEdit3"; this.riPopup.AutoHeight = false; this.riPopup.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) }); this.riPopup.Name = "riPopup"; this.repositoryItemTimeEdit1.AutoHeight = false; this.repositoryItemTimeEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton() }); this.repositoryItemTimeEdit1.Name = "repositoryItemTimeEdit1"; this.repositoryItemTextEdit1.Appearance.Font = new Font("Arial", 12f, FontStyle.Bold, GraphicsUnit.Point, 0); this.repositoryItemTextEdit1.Appearance.Options.UseFont = true; this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1"; this.riPictureStatus.Name = "riPictureStatus"; this.riPictureStatus.PictureAlignment = ContentAlignment.MiddleLeft; this.riPictureStatus.ReadOnly = true; this.riPictureStatus.Click += new EventHandler(this.riTextPriority_Click); this.riButtonStatus.AllowFocused = false; this.riButtonStatus.AllowNullInput = DefaultBoolean.True; this.riButtonStatus.AutoHeight = false; this.riButtonStatus.Name = "riButtonStatus"; this.riButtonStatus.ReadOnly = true; this.riButtonStatus.TextEditStyle = TextEditStyles.DisableTextEditor; this.riButtonStatus.Click += new EventHandler(this.riTextPriority_Click); this.riButtonStatus.ButtonClick += new ButtonPressedEventHandler(this.riButtonStatus_ButtonClick); this.riTextPriority.AutoHeight = false; this.riTextPriority.Name = "riTextPriority"; this.riTextPriority.ReadOnly = true; this.riTextPriority.Click += new EventHandler(this.riTextPriority_Click); this.colTime.Caption = "Time"; this.colTime.ColumnEdit = this.repositoryItemTimeEdit1; this.colTime.FieldName = "DateTime"; this.colTime.Name = "colTime"; this.colTime.OptionsColumn.AllowEdit = false; this.colTime.Visible = true; this.colTime.VisibleIndex = 0; this.colType.Caption = "Type"; this.colType.FieldName = "LogType"; this.colType.Name = "colType"; this.colType.OptionsColumn.AllowEdit = false; this.colType.Visible = true; this.colType.VisibleIndex = 1; this.colDescription.Caption = "Description"; this.colDescription.FieldName = "Description"; this.colDescription.Name = "colDescription"; this.colDescription.OptionsColumn.AllowEdit = false; this.colDescription.Visible = true; this.colDescription.VisibleIndex = 2; this.colData.Caption = "Data"; this.colData.ColumnEdit = this.riPopup; this.colData.FieldName = "Data"; this.colData.Name = "colData"; this.colData.Visible = true; this.colData.VisibleIndex = 3; this.rbAeon.Anchor = AnchorStyles.Left | AnchorStyles.Bottom; this.rbAeon.CheckAlign = ContentAlignment.BottomCenter; this.rbAeon.FlatStyle = FlatStyle.Flat; this.rbAeon.Image = Resources.aeon1; this.rbAeon.ImageAlign = ContentAlignment.TopCenter; this.rbAeon.Location = new Point(12, 0x1a7); this.rbAeon.Name = "rbAeon"; this.rbAeon.Size = new Size(0xc6, 0xf5); base.ttDefault.SetSuperTip(this.rbAeon, null); this.rbAeon.TabIndex = 0x25; this.rbAeon.Text = "Aeon"; this.rbAeon.TextAlign = ContentAlignment.BottomCenter; this.rbAeon.TextImageRelation = TextImageRelation.TextAboveImage; this.rbAeon.UseVisualStyleBackColor = true; this.rbAeon.Paint += new PaintEventHandler(this.rbRandom_Paint); this.rbAeon.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged); this.rbCybran.Anchor = AnchorStyles.Left | AnchorStyles.Bottom; this.rbCybran.CheckAlign = ContentAlignment.BottomCenter; this.rbCybran.FlatStyle = FlatStyle.Flat; this.rbCybran.Image = Resources.cybran1; this.rbCybran.ImageAlign = ContentAlignment.TopCenter; this.rbCybran.Location = new Point(0xd0, 0x1a7); this.rbCybran.Name = "rbCybran"; this.rbCybran.Size = new Size(0xc6, 0xf5); base.ttDefault.SetSuperTip(this.rbCybran, null); this.rbCybran.TabIndex = 0x26; this.rbCybran.Text = "Cybran"; this.rbCybran.TextAlign = ContentAlignment.BottomCenter; this.rbCybran.TextImageRelation = TextImageRelation.TextAboveImage; this.rbCybran.UseVisualStyleBackColor = true; this.rbCybran.Paint += new PaintEventHandler(this.rbRandom_Paint); this.rbCybran.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged); this.rbUEF.Anchor = AnchorStyles.Left | AnchorStyles.Bottom; this.rbUEF.CheckAlign = ContentAlignment.BottomCenter; this.rbUEF.FlatStyle = FlatStyle.Flat; this.rbUEF.Image = Resources.uef1; this.rbUEF.ImageAlign = ContentAlignment.TopCenter; this.rbUEF.Location = new Point(410, 0x1a7); this.rbUEF.Name = "rbUEF"; this.rbUEF.Size = new Size(0xc6, 0xf5); base.ttDefault.SetSuperTip(this.rbUEF, null); this.rbUEF.TabIndex = 0x27; this.rbUEF.Text = "UEF"; this.rbUEF.TextAlign = ContentAlignment.BottomCenter; this.rbUEF.TextImageRelation = TextImageRelation.TextAboveImage; this.rbUEF.UseVisualStyleBackColor = true; this.rbUEF.Paint += new PaintEventHandler(this.rbRandom_Paint); this.rbUEF.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged); this.rbRandom.Anchor = AnchorStyles.Left | AnchorStyles.Bottom; this.rbRandom.BackColor = Color.Black; this.rbRandom.CheckAlign = ContentAlignment.BottomCenter; this.rbRandom.Checked = true; this.rbRandom.FlatStyle = FlatStyle.Flat; this.rbRandom.Image = Resources.random1; this.rbRandom.ImageAlign = ContentAlignment.TopCenter; this.rbRandom.Location = new Point(0x329, 0x1a7); this.rbRandom.Name = "rbRandom"; this.rbRandom.Size = new Size(0xc6, 0xf5); base.ttDefault.SetSuperTip(this.rbRandom, null); this.rbRandom.TabIndex = 40; this.rbRandom.TabStop = true; this.rbRandom.Text = "<LOC>Random"; this.rbRandom.TextAlign = ContentAlignment.BottomCenter; this.rbRandom.TextImageRelation = TextImageRelation.TextAboveImage; this.rbRandom.UseVisualStyleBackColor = false; this.rbRandom.Paint += new PaintEventHandler(this.rbRandom_Paint); this.rbRandom.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged); this.lMapPrefs.AutoGrowDirection = GrowDirections.None; this.lMapPrefs.AutoSize = true; this.lMapPrefs.AutoStyle = true; this.lMapPrefs.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.lMapPrefs.ForeColor = Color.White; this.lMapPrefs.IgnoreMouseWheel = false; this.lMapPrefs.IsStyled = false; this.lMapPrefs.Location = new Point(0x15, 0x3e); this.lMapPrefs.Name = "lMapPrefs"; this.lMapPrefs.Size = new Size(0x263, 0x10); base.ttDefault.SetSuperTip(this.lMapPrefs, null); this.lMapPrefs.TabIndex = 0x29; this.lMapPrefs.Text = "<LOC>Step 1: Select your map preferences -- you may have only one thumbs up and one thumbs down."; this.lMapPrefs.TextStyle = TextStyles.Default; this.gpgLabel1.Anchor = AnchorStyles.Left | AnchorStyles.Bottom; this.gpgLabel1.AutoGrowDirection = GrowDirections.None; this.gpgLabel1.AutoSize = true; this.gpgLabel1.AutoStyle = true; this.gpgLabel1.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.gpgLabel1.ForeColor = Color.White; this.gpgLabel1.IgnoreMouseWheel = false; this.gpgLabel1.IsStyled = false; this.gpgLabel1.Location = new Point(12, 0x189); this.gpgLabel1.Name = "gpgLabel1"; this.gpgLabel1.Size = new Size(0xcc, 0x10); base.ttDefault.SetSuperTip(this.gpgLabel1, null); this.gpgLabel1.TabIndex = 0x2a; this.gpgLabel1.Text = "<LOC>Step 2: Select your faction"; this.gpgLabel1.TextStyle = TextStyles.Default; this.skinButtonCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; this.skinButtonCancel.AutoStyle = true; this.skinButtonCancel.BackColor = Color.Black; this.skinButtonCancel.ButtonState = 0; this.skinButtonCancel.DialogResult = DialogResult.OK; this.skinButtonCancel.DisabledForecolor = Color.Gray; this.skinButtonCancel.DrawColor = Color.White; this.skinButtonCancel.DrawEdges = true; this.skinButtonCancel.FocusColor = Color.Yellow; this.skinButtonCancel.Font = new Font("Verdana", 8f, FontStyle.Bold); this.skinButtonCancel.ForeColor = Color.White; this.skinButtonCancel.HorizontalScalingMode = ScalingModes.Tile; this.skinButtonCancel.IsStyled = true; this.skinButtonCancel.Location = new Point(870, 0x2a2); this.skinButtonCancel.Name = "skinButtonCancel"; this.skinButtonCancel.Size = new Size(0x61, 0x17); this.skinButtonCancel.SkinBasePath = @"Controls\Button\Round Edge"; base.ttDefault.SetSuperTip(this.skinButtonCancel, null); this.skinButtonCancel.TabIndex = 0x2d; this.skinButtonCancel.TabStop = true; this.skinButtonCancel.Text = "<LOC>Cancel"; this.skinButtonCancel.TextAlign = ContentAlignment.MiddleCenter; this.skinButtonCancel.TextPadding = new Padding(0); this.skinButtonCancel.Click += new EventHandler(this.skinButtonCancel_Click); this.skinButtonSearch.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; this.skinButtonSearch.AutoStyle = true; this.skinButtonSearch.BackColor = Color.Black; this.skinButtonSearch.ButtonState = 0; this.skinButtonSearch.DialogResult = DialogResult.OK; this.skinButtonSearch.DisabledForecolor = Color.Gray; this.skinButtonSearch.DrawColor = Color.White; this.skinButtonSearch.DrawEdges = true; this.skinButtonSearch.FocusColor = Color.Yellow; this.skinButtonSearch.Font = new Font("Verdana", 8f, FontStyle.Bold); this.skinButtonSearch.ForeColor = Color.White; this.skinButtonSearch.HorizontalScalingMode = ScalingModes.Tile; this.skinButtonSearch.IsStyled = true; this.skinButtonSearch.Location = new Point(0x2ff, 0x2a2); this.skinButtonSearch.Name = "skinButtonSearch"; this.skinButtonSearch.Size = new Size(0x61, 0x17); this.skinButtonSearch.SkinBasePath = @"Controls\Button\Round Edge"; base.ttDefault.SetSuperTip(this.skinButtonSearch, null); this.skinButtonSearch.TabIndex = 0x2e; this.skinButtonSearch.TabStop = true; this.skinButtonSearch.Text = "<LOC>Start Search"; this.skinButtonSearch.TextAlign = ContentAlignment.MiddleCenter; this.skinButtonSearch.TextPadding = new Padding(0); this.skinButtonSearch.Click += new EventHandler(this.skinButton1_Click); this.rbSeraphim.Anchor = AnchorStyles.Left | AnchorStyles.Bottom; this.rbSeraphim.BackColor = Color.Black; this.rbSeraphim.CheckAlign = ContentAlignment.BottomCenter; this.rbSeraphim.FlatStyle = FlatStyle.Flat; this.rbSeraphim.Image = Resources.seraphim; this.rbSeraphim.ImageAlign = ContentAlignment.TopCenter; this.rbSeraphim.Location = new Point(610, 0x1a7); this.rbSeraphim.Name = "rbSeraphim"; this.rbSeraphim.Size = new Size(0xc6, 0xf5); base.ttDefault.SetSuperTip(this.rbSeraphim, null); this.rbSeraphim.TabIndex = 0x2f; this.rbSeraphim.Text = "Seraphim"; this.rbSeraphim.TextAlign = ContentAlignment.BottomCenter; this.rbSeraphim.TextImageRelation = TextImageRelation.TextAboveImage; this.rbSeraphim.UseVisualStyleBackColor = false; this.rbSeraphim.Paint += new PaintEventHandler(this.rbRandom_Paint); this.rbSeraphim.CheckedChanged += new EventHandler(this.rbSeraphim_CheckedChanged); base.AcceptButton = this.skinButtonSearch; base.AutoScaleMode = AutoScaleMode.None; base.CancelButton = this.skinButtonCancel; base.ClientSize = new Size(0x400, 740); base.Controls.Add(this.rbSeraphim); base.Controls.Add(this.skinButtonSearch); base.Controls.Add(this.skinButtonCancel); base.Controls.Add(this.gpgLabel1); base.Controls.Add(this.lMapPrefs); base.Controls.Add(this.rbRandom); base.Controls.Add(this.rbUEF); base.Controls.Add(this.rbCybran); base.Controls.Add(this.rbAeon); base.Controls.Add(this.gpgMapSelectGrid); this.Font = new Font("Verdana", 8f); base.Location = new Point(0, 0); this.MinimumSize = new Size(0x400, 740); base.Name = "DlgSupcomMapOptions"; base.ttDefault.SetSuperTip(this, null); this.Text = "<LOC>Ranked Match Preferences"; base.Controls.SetChildIndex(this.gpgMapSelectGrid, 0); base.Controls.SetChildIndex(this.rbAeon, 0); base.Controls.SetChildIndex(this.rbCybran, 0); base.Controls.SetChildIndex(this.rbUEF, 0); base.Controls.SetChildIndex(this.rbRandom, 0); base.Controls.SetChildIndex(this.lMapPrefs, 0); base.Controls.SetChildIndex(this.gpgLabel1, 0); base.Controls.SetChildIndex(this.skinButtonCancel, 0); base.Controls.SetChildIndex(this.skinButtonSearch, 0); base.Controls.SetChildIndex(this.rbSeraphim, 0); ((ISupportInitialize) base.pbBottom).EndInit(); this.gpgMapSelectGrid.EndInit(); this.cardView1.EndInit(); this.riPriority.EndInit(); this.riMap.EndInit(); this.rimPictureEdit3.EndInit(); this.rimTextEdit.EndInit(); this.rimMemoEdit3.EndInit(); this.riPopup.EndInit(); this.repositoryItemTimeEdit1.EndInit(); this.repositoryItemTextEdit1.EndInit(); this.riPictureStatus.EndInit(); this.riButtonStatus.EndInit(); this.riTextPriority.EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
public void CardClicked(CardView cardView, int mouseButton) { if (cardView != null) { cardClickedMethodInfo.Invoke (battleMode, new object[] { cardView, mouseButton }); } }
private void gettextures(CardView cardView) { // get textures from cardview (because cardview issnt painted above ongui drawing, so we draw the textures ongui :D) this.gameObjects.Clear(); GameObject go1 = (GameObject)cardImageField.GetValue(cardView); cardtextures temp1 = new cardtextures(); temp1.cardimgimg = go1.renderer.material.mainTexture; Vector3 vec1 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.min); Vector3 vec2 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.max); Rect rec = new Rect(vec1.x, Screen.height - vec2.y, vec2.x - vec1.x, vec2.y - vec1.y); temp1.cardimgrec = rec; if (go1.renderer.enabled) { this.gameObjects.Add(temp1); } // card-texture temp1 = new cardtextures(); temp1.cardimgimg = cardtext; temp1.cardimgrec = cardrect; this.gameObjects.Add(temp1); //icon background go1 = (GameObject)icoBGField.GetValue(cardView); temp1 = new cardtextures(); temp1.cardimgimg = go1.renderer.material.mainTexture; Vector3 ttvec1 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.min); Vector3 ttvec2 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.max); Rect ttrec = new Rect(ttvec1.x, Screen.height - ttvec2.y, ttvec2.x - ttvec1.x, ttvec2.y - ttvec1.y); temp1.cardimgrec = ttrec; if (go1.renderer.enabled) { this.gameObjects.Add(temp1); } //stats background go1 = (GameObject)statsBGField.GetValue(cardView); temp1 = new cardtextures(); temp1.cardimgimg = go1.renderer.material.mainTexture; ttvec1 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.min); ttvec2 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.max); ttrec = new Rect(ttvec1.x, Screen.height - ttvec2.y, ttvec2.x - ttvec1.x, ttvec2.y - ttvec1.y); temp1.cardimgrec = ttrec; if (go1.renderer.enabled) { this.gameObjects.Add(temp1); } //ico go1 = (GameObject)icoField.GetValue(cardView); temp1 = new cardtextures(); temp1.cardimgimg = go1.renderer.material.mainTexture; ttvec1 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.min); ttvec2 = Camera.main.WorldToScreenPoint(go1.renderer.bounds.max); ttrec = new Rect(ttvec1.x, Screen.height - ttvec2.y, ttvec2.x - ttvec1.x, ttvec2.y - ttvec1.y); temp1.cardimgrec = ttrec; if (go1.renderer.enabled) { this.gameObjects.Add(temp1); } List<GameObject> Images = (List<GameObject>)gosNumHitPointsField.GetValue(cardView); foreach (GameObject go in Images) { cardtextures temp = new cardtextures(); temp.cardimgimg = go.renderer.material.mainTexture; Vector3 tvec1 = Camera.main.WorldToScreenPoint(go.renderer.bounds.min); Vector3 tvec2 = Camera.main.WorldToScreenPoint(go.renderer.bounds.max); Rect trec = new Rect(tvec1.x, Screen.height - tvec2.y, tvec2.x - tvec1.x, tvec2.y - tvec1.y); temp.cardimgrec = trec; if (go.renderer.enabled) { this.gameObjects.Add(temp); } } //ability background Images = (List<GameObject>)gosactiveAbilityField.GetValue(cardView); foreach (GameObject go in Images) { if (go.name == "Trigger_Ability_Button") { cardtextures temp = new cardtextures(); temp.cardimgimg = go.renderer.material.mainTexture; Vector3 tvec1 = Camera.main.WorldToScreenPoint(go.renderer.bounds.min); Vector3 tvec2 = Camera.main.WorldToScreenPoint(go.renderer.bounds.max); Rect trec = new Rect(tvec1.x, Screen.height - tvec2.y, tvec2.x - tvec1.x, tvec2.y - tvec1.y); temp.cardimgrec = trec; if (go.renderer.enabled) { this.gameObjects.Add(temp); } break; } } Images = (List<GameObject>)gosNumCostField.GetValue(cardView); foreach (GameObject go in Images) { cardtextures temp = new cardtextures(); temp.cardimgimg = go.renderer.material.mainTexture; Vector3 tvec1 = Camera.main.WorldToScreenPoint(go.renderer.bounds.min); Vector3 tvec2 = Camera.main.WorldToScreenPoint(go.renderer.bounds.max); Rect trec = new Rect(tvec1.x, Screen.height - tvec2.y, tvec2.x - tvec1.x, tvec2.y - tvec1.y); temp.cardimgrec = trec; if (go.renderer.enabled) { this.gameObjects.Add(temp); } } Images = (List<GameObject>)gosNumAttackPowerField.GetValue(cardView); foreach (GameObject go in Images) { cardtextures temp = new cardtextures(); temp.cardimgimg = go.renderer.material.mainTexture; Vector3 tvec1 = Camera.main.WorldToScreenPoint(go.renderer.bounds.min); Vector3 tvec2 = Camera.main.WorldToScreenPoint(go.renderer.bounds.max); Rect trec = new Rect(tvec1.x, Screen.height - tvec2.y, tvec2.x - tvec1.x, tvec2.y - tvec1.y); temp.cardimgrec = trec; if (go.renderer.enabled) { this.gameObjects.Add(temp); } } Images = (List<GameObject>)gosNumCountdownField.GetValue(cardView); foreach (GameObject go in Images) { cardtextures temp = new cardtextures(); temp.cardimgimg = go.renderer.material.mainTexture; Vector3 tvec1 = Camera.main.WorldToScreenPoint(go.renderer.bounds.min); Vector3 tvec2 = Camera.main.WorldToScreenPoint(go.renderer.bounds.max); Rect trec = new Rect(tvec1.x, Screen.height - tvec2.y, tvec2.x - tvec1.x, tvec2.y - tvec1.y); temp.cardimgrec = trec; if (go.renderer.enabled) { this.gameObjects.Add(temp); } } textsArr.Clear(); Images = (List<GameObject>)textsArrField.GetValue(cardView); foreach (GameObject go in Images) { TextMesh lol = go.GetComponentInChildren<TextMesh>(); renderwords stuff; stuff.text = lol.text; Vector3 tvec1 = Camera.main.WorldToScreenPoint(go.renderer.bounds.min); Vector3 tvec2 = Camera.main.WorldToScreenPoint(go.renderer.bounds.max); Rect trec = new Rect(tvec1.x, Screen.height - tvec2.y, tvec2.x - tvec1.x, tvec2.y - tvec1.y); stuff.rect = trec; GUIStyle style = new GUIStyle(); style.font = lol.font; style.alignment = (TextAnchor)lol.alignment; style.fontSize = (int)(lol.fontSize); style.wordWrap = false; style.stretchHeight = false; style.stretchWidth = false; stuff.color = new Color(go.renderer.material.color.r, go.renderer.material.color.g, go.renderer.material.color.b, 0.9f); style.normal.textColor = stuff.color; stuff.style = style; textsArr.Add(stuff); } }
public void AddCard(Card card) { QslCard = card; double left = (this.Width - card.DisplayWidth) / 2; double top = (this.Height - card.DisplayHeight) / 2; cardView = new CardView(QslCard); Canvas.SetLeft(cardView, left); Canvas.SetTop(cardView, top); this.Children.Add(cardView); }
/// <summary> /// Helper method to handle MouseMove events when the related CardItem is selected /// but the left mouse button is not down. This method is overridden in ImageView, /// TextItemView, and QsosBoxView classes. /// </summary> /// <param name="e">MouseEventArgs object</param> protected virtual void HandleMouseMoveWithLeftMouseButtonUp(CardView view, MouseEventArgs e) { throw new NotImplementedException(); }