” fanidan “ checkbox ” mavzusidagi


Download 170.49 Kb.
bet15/15
Sana24.12.2022
Hajmi170.49 Kb.
#1057493
1   ...   7   8   9   10   11   12   13   14   15
// Popup mouseover rectangle is actually bigger than GetCheckmarkRectangle()
return Adapter.CommonLayout().Layout().checkBounds;
}
}
}
///
///
///
///

/// Gets or sets a value indicating the alignment of the
/// text on the checkbox control.
///
///

///
[
Localizable(true),
DefaultValue(ContentAlignment.MiddleLeft)
]
public override ContentAlignment TextAlign {
get {
return base.TextAlign;
}
set {
base.TextAlign = value;
}
}
///
///
///
Gets or sets a value indicating

/// whether the check box will allow three check states rather than two.

///
[
DefaultValue(false),
SRCategory(SR.CatBehavior),
SRDescription(SR.CheckBoxThreeStateDescr)
]
public bool ThreeState {
get {
return threeState;
}
set {
threeState = value;
}
}
///
///
///
Occurs when the

/// value of the
/// property changes.

///
[SRDescription(SR.CheckBoxOnCheckedChangedDescr)]
public event EventHandler CheckedChanged {
add {
Events.AddHandler(EVENT_CHECKEDCHANGED, value);
}
remove {
Events.RemoveHandler(EVENT_CHECKEDCHANGED, value);
}
}
///
///
///
Occurs when the

/// value of the
/// property changes.

///
[SRDescription(SR.CheckBoxOnCheckStateChangedDescr)]
public event EventHandler CheckStateChanged {
add {
Events.AddHandler(EVENT_CHECKSTATECHANGED, value);
}
remove {
Events.RemoveHandler(EVENT_CHECKSTATECHANGED, value);
}
}
///
///
///
///

/// Constructs the new instance of the accessibility object for this control. Subclasses
/// should not call base.CreateAccessibilityObject.
///

///
protected override AccessibleObject CreateAccessibilityInstance() {
return new CheckBoxAccessibleObject(this);
}
///
///
///
[To be supplied.]

///
protected virtual void OnAppearanceChanged(EventArgs e) {
EventHandler eh = Events[EVENT_APPEARANCECHANGED] as EventHandler;
if (eh != null) {
eh(this, e);
}
}
///
///
///
Raises the

/// event.

///
protected virtual void OnCheckedChanged(EventArgs e) {
// accessibility stuff
if (this.FlatStyle == FlatStyle.System) {
AccessibilityNotifyClients(AccessibleEvents.SystemCaptureStart, -1);
}
AccessibilityNotifyClients(AccessibleEvents.StateChange, -1);
AccessibilityNotifyClients(AccessibleEvents.NameChange, -1);
if (this.FlatStyle == FlatStyle.System) {
AccessibilityNotifyClients(AccessibleEvents.SystemCaptureEnd, -1);
}
EventHandler handler = (EventHandler)Events[EVENT_CHECKEDCHANGED];
if (handler != null) handler(this,e);
}
///
///
///
Raises the event.

///
protected virtual void OnCheckStateChanged(EventArgs e) {
if (OwnerDraw) {
Refresh();
}
EventHandler handler = (EventHandler)Events[EVENT_CHECKSTATECHANGED];
if (handler != null) handler(this,e);
}
///
///
///
///

/// Fires the event indicating that the control has been clicked.
/// Inheriting controls should use this in favour of actually listening to
/// the event, but should not forget to call base.onClicked() to
/// ensure that the event is still fired for external listeners.
///
///

///
protected override void OnClick(EventArgs e) {
if (autoCheck) {
switch (CheckState) {
case CheckState.Unchecked:
CheckState = CheckState.Checked;
break;
case CheckState.Checked:
if (threeState) {
CheckState = CheckState.Indeterminate;
// If the check box is clicked as a result of AccObj::DoDefaultAction
// then the native check box does not fire OBJ_STATE_CHANGE event when going to Indeterminate state.
// So the WinForms layer fires the OBJ_STATE_CHANGE event.
// vsw 543351.
if (this.AccObjDoDefaultAction) {
AccessibilityNotifyClients(AccessibleEvents.StateChange, -1);
}
}
else {
CheckState = CheckState.Unchecked;
}
break;
default:
CheckState = CheckState.Unchecked;
break;
}
}
base.OnClick(e);
}
///
///
/// We override this to ensure that the control's click values are set up
/// correctly.
///
///
protected override void OnHandleCreated(EventArgs e) {
base.OnHandleCreated(e);
// Since this is a protected override...
// this can be directly called in by a overriden class..
// and the Handle need not be created...
// So Check for the handle
if (IsHandleCreated) {
SendMessage(NativeMethods.BM_SETCHECK, (int)checkState, 0);
}
}
///
/// We override this to ensure that press '+' or '=' checks the box,
/// while pressing '-' unchecks the box
///
///
protected override void OnKeyDown(KeyEventArgs e) {
//this fixes bug 235019, but it will be a breaking change from Everett
//see the comments attached to bug 235019
/*
if (Enabled) {
if (e.KeyCode == Keys.Oemplus || e.KeyCode == Keys.Add) {
CheckState = CheckState.Checked;
}
if (e.KeyCode == Keys.OemMinus || e.KeyCode == Keys.Subtract) {
CheckState = CheckState.Unchecked;
}
}
*/
base.OnKeyDown(e);
}
///
///
///
///

/// Raises the event.
///
///

///
protected override void OnMouseUp(MouseEventArgs mevent) {
if (mevent.Button == MouseButtons.Left && MouseIsPressed) {
// It's best not to have the mouse captured while running Click events
if (base.MouseIsDown) {
Point pt = PointToScreen(new Point(mevent.X, mevent.Y));
if (UnsafeNativeMethods.WindowFromPoint(pt.X, pt.Y) == Handle) {
//Paint in raised state...
ResetFlagsandPaint();
if (!ValidationCancelled) {
if (this.Capture) {
OnClick(mevent);
}
OnMouseClick(mevent);
}
}
}
}
base.OnMouseUp(mevent);
}
internal override ButtonBaseAdapter CreateFlatAdapter() {
return new CheckBoxFlatAdapter(this);
}
internal override ButtonBaseAdapter CreatePopupAdapter() {
return new CheckBoxPopupAdapter(this);
}
internal override ButtonBaseAdapter CreateStandardAdapter() {
return new CheckBoxStandardAdapter(this);
}
///
///
/// Overridden to handle mnemonics properly.
///
///
[UIPermission(SecurityAction.LinkDemand, Window=UIPermissionWindow.AllWindows)]
protected internal override bool ProcessMnemonic(char charCode) {
if (UseMnemonic && IsMnemonic(charCode, Text) && CanSelect) {
if (FocusInternal()) {
//Paint in raised state...
//
ResetFlagsandPaint();
if (!ValidationCancelled) {
OnClick(EventArgs.Empty);
}
}
return true;
}
return false;
}
///
///
/// Provides some interesting information for the CheckBox control in
/// String form.
///
///
public override string ToString() {
string s = base.ToString();
// C#R cpb: 14744 ([....]) We shouldn't need to convert the enum to int -- EE M10 workitem.
int checkState = (int)CheckState;
return s + ", CheckState: " + checkState.ToString(CultureInfo.InvariantCulture);
}
///
///
///
///
[System.Runtime.InteropServices.ComVisible(true)]
public class CheckBoxAccessibleObject : ButtonBaseAccessibleObject {
///
///
///
[To be supplied.]

///
public CheckBoxAccessibleObject(Control owner) : base(owner) {
}
///
///
///
[To be supplied.]

///
public override string DefaultAction {
get {
string defaultAction = Owner.AccessibleDefaultActionDescription;
if (defaultAction != null) {
return defaultAction;
}
if (((CheckBox)Owner).Checked) {
return SR.GetString(SR.AccessibleActionUncheck);
}
else {
return SR.GetString(SR.AccessibleActionCheck);
}
}
}
///
///
///
[To be supplied.]

///
public override AccessibleRole Role {
get {
AccessibleRole role = Owner.AccessibleRole;
if (role != AccessibleRole.Default) {
return role;
}
return AccessibleRole.CheckButton;
}
}
///
///
///
[To be supplied.]

///
public override AccessibleStates State {
get {
switch (((CheckBox)Owner).CheckState) {
case CheckState.Checked:
return AccessibleStates.Checked | base.State;
case CheckState.Indeterminate:
return AccessibleStates.Indeterminate | base.State;
}
return base.State;
}
}
///
///
///
[To be supplied.]

///
[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public override void DoDefaultAction() {
CheckBox cb = this.Owner as CheckBox;
if (cb != null) {
cb.AccObjDoDefaultAction = true;
}
try {
base.DoDefaultAction();
} finally {
if (cb != null) {
cb.AccObjDoDefaultAction = false;
}
}
}
}
}
}

Xulosa
Mamlakatimizda istiqlolning dastlabki yillaridan boshlab ta’lim-tarbiya tizimini tubdan isloh qilishga alohida e’tibor qaratilib, farzandlarimizning jahon andozalari darajasida zamonaviy bilim va kasb-hunarlarni egallashi, jismonan va ma’nan yetuk insonlar bo‘lib ulg‘ayishi, ularning qobiliyat va iste’dodini, intellektual salohiyatini yuzaga chiqarish, yosh avlod qalbida Vatanga sadoqat va fidoyilik tuyg‘ularini yuksaltirish borasida ulkan ishlar amalga oshirilmoqda. Prezidentimizning 2017-yil 7-fevraldagi "O‘zbekiston Respublikasini yanada rivojlantirish bo‘yicha Harakatlar strategiyasi to‘g‘risida"gi farmonida ijtimoiy soha, xususan, ta’lim va ilm-fan sohalarini takomillashtirish borasida qator vazifalar belgilangan. 
Ayni shu vazifalardan kelib chiqib, ushbu kurs ishimizni tayyorlashdan asosiy maqsad talabalarga dasturlash tili fanidan C# dasturlash tilida dastur tuzish uchun boshlang`ich ma`lumotlarga ega bo`lish hamda ushbu dasturlash tilida checkbox komponentasi dasturini tuzish bo`yicha yo`l –yo`riqlarga ega bo`lish uchun yaratilgan.
Hozirgi kunda C# dasturlash tili yuqori bosqichli dasturlash tillari ichida eng
samarali dasturlash tillaridan hisoblanadi. C# dasturlash tili obektga mo’ljallangan dasturlash tilidir. Hozirgi kurs ishimizning birinchi nazariy qismida asosan C# dasturlash tili haqida ma`lumotlar berilgan. Nazariy qism ikkita bo`limdan iborat bo`lib, birinchi bo`limda C# dasturlash tili tarixi haqida, ikkinchi bo`lim esa C# dagi strukturalar haqida va boshqa ma`lumotlar haqida ham keltirilgan. Ikkinchi amaliy qismida esa C# dasturlash tilida “Checkbox komponentasi” dasturini tuzish haqida malumotlar keltirilgan. Amaliy qismda dastur tuzish uchun biz Windiws Aplicationdan foydalanganmiz va dizayn qismini ham yaratganmiz. Bu amaliy qismdagi amallarni ketma-ketligini bajarish orqali har bir o`quvchi C# dasturlash tilida checkbox komponentasi dasturini tuzish imkoniga ega bo`ldi.


Foydalanilgan adabiyotlar

  1. 1. I.A.Karimov. Yuksak ma’naviyat yengilmas kuch:-Toshkent: O’zbekiston, 2008y

  2. Павел Агуров. C# Сборник рецептов: -Москва: Санкт-Петербург,

2008г.
3.Трей Неш. C# 2008 усконренный курс для профессионалов: -Москва:
Санкт-Петербург, Киев, 2008г
4. Павел Агуров. C# Сборник рецептов: -Москва: Санкт-Петербург,
2008г. - 432 с.
5. Дейтел Х, Дейтел П, Листфилд Дж. C# Наиболее полное руководство
В Подлиннике: -Москва: Санкт-Петербург, 2006г.
6.. Шилдт Герберт. Полный справочник по С#. : Пер. с англ. — М. :
Издательский дом "Вильяме", 2004. — . : ил.
7. Aripov M.M., Imomov T., Irmuhamedov Z.M. va boshqalar. Informatika.
Axborot texnologiyalari. Toshkent, 1-qism. 2002, 2-qism. 2003,
8. Aripov M. Informatika va hisoblash texnikasi asoslari.Tashkent,2001,1



Download 170.49 Kb.

Do'stlaringiz bilan baham:
1   ...   7   8   9   10   11   12   13   14   15




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling