'분류 전체보기'에 해당되는 글 84건
- 2010.09.22 [Qt Designer] 확장 다이얼로그
- 2010.09.19 [GUI] Empty Form
- 2010.09.18 Qt Designer
- 2010.09.07 정규식을 이용한 주민등록번호 추출
- 2010.08.31 java
- 2010.08.26 쓰레드
- 2010.08.24 오토박싱/언박싱
- 2010.08.23 [ImageButton, Toast]
- 2010.08.23 용어 tabstop shiftwidth
- 2010.08.23 Stream
전체 다이얼로그 작성
More 버튼 (toggle) -> 확장될 위젯들 (setVisible)
cpp의 생성자에서 확장될 위젯들은 hide()
-'Qt' 카테고리의 다른 글
qt 메뉴 등록 (0) | 2010.09.23 |
---|---|
Qt Designer (0) | 2010.09.18 |
Qt Creator Manual (0) | 2010.06.10 |
Qt Compile (0) | 2010.06.06 |
-
1. File | new Project
Empty Project 선택, Name 지정 (EmptyForm)
2. Project | Add Reference
.Net 탭에서 System.Windows.Form 선택
3. 코드 작성
EmptyForm.cs |
FirstWindowApplication
|
AFormBasedWindowSkeleton.cs |
ExitApplication.cs
|
ButtonEventHnadler.cs
using System;
using System.Windows.Forms;
using System.Drawing;
public class ButtonClickEvent : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
public ButtonClickEvent()
{
Text = "Test WinForm";
ForeColor = System.Drawing.Color.Yellow;
button1 = new System.Windows.Forms.Button();
textBox1 = new System.Windows.Forms.TextBox();
button1.Location = new System.Drawing.Point(8, 32);
button1.Name = "button1";
button1.Size = new System.Drawing.Size(104, 32);
button1.TabIndex = 0;
button1.Text = "Click Me";
textBox1.Location = new System.Drawing.Point(24, 104);
textBox1.Name = "textBox1";
textBox1.Size = new System.Drawing.Size(184, 20);
textBox1.TabIndex = 1;
textBox1.Text = "textBox1";
Controls.AddRange(new System.Windows.Forms.Control[]{textBox1, button1});
button1.Click += new System.EventHandler(button1_Click);
}
private void button1_Click(object sender, System.EventArgs e)
{
textBox1.Text = "Button is clicked";
MessageBox.Show("Button is clicked");
}
public static int Main()
{
Application.Run(new ButtonClickEvent());
return 0;
}
} |
SeparateMainClass.cs
using System;
using System.Drawing;
using System.Windows.Forms;
class SeparateMain
{
public static void Main()
{
Application.Run(new AnotherHelloWorld());
}
}
class AnotherHelloWorld : Form
{
public AnotherHelloWorld()
{
Text = "Another HelloWolrd";
BackColor = Color.White;
}
protected override void OnPaint(PaintEventArgs pea)
{
Graphics graphics = pea.Graphics;
graphics.DrawString("Hello, Windows Form!", Font, Brushes.Black, 0, 0);
}
} |
ResumeLayoutAndSuspendLayout.cs
using System;
using System.Windows.Forms;
class MainForm : Form
{
private Label label1;
private TextBox textBox1;
private Button button1;
public MainForm()
{
this.label1 = new Label();
this.textBox1 = new TextBox();
this.button1 = new Button();
this.SuspendLayout();
this.label1.Location = new System.Drawing.Point(16, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(128, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Please enter your name:";
this.textBox1.Location = new System.Drawing.Point(152, 32);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
this.button1.Location = new System.Drawing.Point(109, 80);
this.button1.Name = "button1";
this.button1.TabIndex = 2;
this.button1.Text = "Enter";
this.button1.Click += new System.EventHandler(this.button1_Click);
this.ClientSize = new System.Drawing.Size(292, 126);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Name = "form1";
this.Text = "Visual C#";
this.ResumeLayout(false);
}
private void button1_Click(object sender, System.EventArgs e)
{
System.Console.WriteLine("User entered: " + textBox1.Text);
MessageBox.Show("Welcome, " + textBox1.Text, "Visual C#");
}
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
} |
23.2.7
ShowFormAndSleep.cs
-
Qt Designer 실행
폼 작성
formname.ui로 저장 (XML 형식)
main.cpp 작성 (ui_formname.h 인클루드)
qmake -project
qmake gotocell.pro -> ui_formname.h (C++ 형식) 생성됨 (fornname.ui --> ui_formname.h : uic가 수행)
formname.h 작성 (ui_formname.h 인클루드, Ui::formname 상속받아야 함)
formname.cpp 작성 (생성자에서 setupUi(this);를 해주어야 함)
main.cpp 수정 (formname.h 인클루드)
-
'Qt' 카테고리의 다른 글
qt 메뉴 등록 (0) | 2010.09.23 |
---|---|
[Qt Designer] 확장 다이얼로그 (0) | 2010.09.22 |
Qt Creator Manual (0) | 2010.06.10 |
Qt Compile (0) | 2010.06.06 |
정규식을 이용한 주민등록 번호 추출 프로그램
RRNTest.java
|
-
레이아웃 변경하기
setLayout(new CardLayout());
Container c = getContentPane();
c.setLayout(new GridLayout());
쓰레드
일시 정지 상태로 만드는 것 : suspend, join, sleep, wait
깨우는 것 : resume, notify
run() 메소드는 Runnable 인터페이스에 존재
Thread 클래스는 Runnable 인터페이스를 임플러먼츠한다.
따라서 Thread클래스를 사용하여 쓰레드를 사용하려면 run() 메소드를 기술해줘야 하고, start() 메소드로 실행해야 한다. start() 메소드는 run() 메소드를 실행한다. 그냥 run()을 실행하면 멀티쓰레드로 동작하지 않는다.
Runnable 인터페이스를 임플러먼츠한 후,
객체를 생성하여 그 객체를
Thread t = new Thread(rr, "Thread1"); 에 넘기고
t.start()로 실행하면 start()가 rr의 run()을 실행함
쓰레드 돌릴때 run()에 반드시 sleep(1)이라도 주어야 cpu 부하 줄어들고, 멀티 쓰레드시 효율이 높다
int n = 10;
Integer wrapN = new Integer(n); //박싱n = wrapN.intValue(); //언박싱
wrapN = n; //오토 박싱
n = wrapN; //오토 언박싱
C++, pasted just now:
|
d
Haskell, pasted 1 second ago:
|
-
'Android' 카테고리의 다른 글
[CustomAdapter] (0) | 2010.09.30 |
---|---|
[MyHandlerTest] (0) | 2010.09.28 |
[AlertDialog2] (0) | 2010.08.19 |
[AlertDialog] (0) | 2010.08.18 |
[MenuTest] (0) | 2010.08.18 |
tabstop : '\t' 문자 자체의 화면에서의 표시 간격
indent size(shiftwidth) : > 또는 <, 그리고 자동 인덴트 같은 곳에서 사용되는 화면에서의 표시 크기
soft tab stop : 탭 키를 눌렀을 때 화면에서 움직일 표시 크기, vim에서는 백스페이스 키에도 적용
et(탭 풀어쓰기) : 탭을 모두 공백 문자로 변환해서 파일에 저장
noet : 소프트탭이나 인덴트가 되었을 때, 탭 크기보다 작은 경우에는 공백 문자로, 탭보다 크면 탭 문자로 처리
'VIM 강좌' 카테고리의 다른 글
folding (0) | 2010.08.15 |
---|---|
ctags & cscope (0) | 2010.08.15 |
vim 사용법 (0) | 2010.06.12 |
Object
ㄴInputStream
ㄴByteArrayInputStream
ㄴFileInputStream
ㄴFilterInputStream
ㄴBufferedInputStream
ㄴObjectInputStream
ㄴPipedInputStream
ㄴSequenceInputStream
ㄴStringBufferInputStream
ㄴOutputStream
ㄴByteArrayOutputStream
ㄴFileOutputStream
ㄴFilterOutputStream
ㄴBufferedOutputStream
ㄴPrintStream
ㄴObjectOutputStream
ㄴPipedOutputStream