Module: Fzeet::DCMethods

Included in:
ClientDC, ScreenDC
Defined in:
lib/fzeet/windows/core/Common.rb

Instance Method Summary collapse

Instance Method Details

#backgroundObject



282
# File 'lib/fzeet/windows/core/Common.rb', line 282

def background; Windows.GetBkColor(@handle) end

#background=(background) ⇒ Object



283
# File 'lib/fzeet/windows/core/Common.rb', line 283

def background=(background) Windows.SetBkColor(@handle, background) end

#colorObject



279
# File 'lib/fzeet/windows/core/Common.rb', line 279

def color; Windows.GetTextColor(@handle) end

#color=(color) ⇒ Object



280
# File 'lib/fzeet/windows/core/Common.rb', line 280

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

#fillRect(rect, brush) ⇒ Object



285
# File 'lib/fzeet/windows/core/Common.rb', line 285

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

#line(x, y) ⇒ Object



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

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

#move(x, y) ⇒ Object



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

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

#select(*objects) ⇒ Object



263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/fzeet/windows/core/Common.rb', line 263

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



289
290
291
292
293
294
295
296
297
# File 'lib/fzeet/windows/core/Common.rb', line 289

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



287
# File 'lib/fzeet/windows/core/Common.rb', line 287

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

#textExtent(text) ⇒ Object



277
# File 'lib/fzeet/windows/core/Common.rb', line 277

def textExtent(text) Windows.DetonateLastError(0, :GetTextExtentPoint, @handle, text, text.length, s = Size.new); s end