Module: Fzeet::DCMethods

Included in:
ClientDC
Defined in:
lib/fzeet/Common.rb

Instance Method Summary collapse

Instance Method Details

#colorObject



299
# File 'lib/fzeet/Common.rb', line 299

def color; Windows.GetTextColor(@handle) end

#color=(color) ⇒ Object



300
# File 'lib/fzeet/Common.rb', line 300

def color=(color) Windows.SetTextColor(@handle, color) end

#fillRect(rect, brush) ⇒ Object



302
# File 'lib/fzeet/Common.rb', line 302

def fillRect(rect, brush) Windows.DetonateLastError(0, :FillRect, @handle, rect, brush.handle); self end

#line(x, y) ⇒ Object



317
# File 'lib/fzeet/Common.rb', line 317

def line(x, y) Windows.DetonateLastError(0, :LineTo, @handle, x, y); self end

#move(x, y) ⇒ Object



316
# File 'lib/fzeet/Common.rb', line 316

def move(x, y) Windows.DetonateLastError(0, :MoveToEx, @handle, x, y, nil); self end

#select(*objects) ⇒ Object



285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/fzeet/Common.rb', line 285

def select(*objects)
	holds = []

	objects.each { |object|
		holds << Windows.DetonateLastError(FFI::Pointer::NULL, :SelectObject, @handle, object.handle)
	}

	yield self

	self
ensure
	holds.each { |hold| Windows.SelectObject(@handle, hold) }
end

#sms(message) ⇒ Object



306
307
308
309
310
311
312
313
314
# File 'lib/fzeet/Common.rb', line 306

def sms(message)
	r = window.rect

	r[:top] += window.ribbon.height if window.ribbon

	text(message, r, [:singleline, :center, :vcenter])

	self
end

#text(text, rect, flags = 0) ⇒ Object



304
# File 'lib/fzeet/Common.rb', line 304

def text(text, rect, flags = 0) Windows.DetonateLastError(0, :DrawText, @handle, text, -1, rect, Fzeet.flags(flags, :dt_)); self end