Class: Fzeet::Scintilla

Inherits:
Control show all
Includes:
ScintillaMethods
Defined in:
lib/fzeet/windows/scintilla.rb

Constant Summary collapse

Prefix =
{
	xstyle: [:ws_ex_],
	style: [:ws_],
	message: [:sci_, :wm_],
	notification: [:scn_, :scen_, :nm_]
}

Constants included from WindowMethods

WindowMethods::EnumChildProc

Instance Attribute Summary

Attributes inherited from Control

#id, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ScintillaMethods

#dirty=, #dirty?, #font, #font=, #fontSize, #fontSize=, #tabWidth, #tabWidth=, #text, #text=

Methods inherited from Control

#dispose

Methods included from WindowMethods

#[], #capture=, #capture?, #dialog=, #dialog?, #dlgmsg?, #drawMenuBar, #eachChild, #enabled=, #enabled?, #focus=, #focus?, #invalidate, #location, #location=, #long, #menu, #menu=, #message, #paint, #position, #position=, #postmsg, #question, #rect, #reframe, #sendmsg, #show, #size, #size=, #style, #style?, #text, #text=, #textlen, #topmost=, #topmost?, #update, #visible=, #visible?, #xstyle, #xstyle?

Methods included from Toggle

#toggle

Constructor Details

#initialize(parent, id, opts = {}, &block) ⇒ Scintilla

Returns a new instance of Scintilla.



2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
# File 'lib/fzeet/windows/scintilla.rb', line 2367

def initialize(parent, id, opts = {}, &block)
	super('Scintilla', parent, id, opts)

	@dirty = false

	on(:savepointleft) { @dirty = true }
	on(:savepointreached) { @dirty = false }

	@parent.on(:notify, @id, &block) if block
end

Class Method Details

.crackNotification(args) ⇒ Object



2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
# File 'lib/fzeet/windows/scintilla.rb', line 2333

def self.crackNotification(args)
	case args[:notification]
	when \
		Windows::SCN_STYLENEEDED,
		Windows::SCN_CHARADDED,
		Windows::SCN_SAVEPOINTREACHED,
		Windows::SCN_SAVEPOINTLEFT,
		Windows::SCN_MODIFYATTEMPTRO,
		Windows::SCN_KEY,
		Windows::SCN_DOUBLECLICK,
		Windows::SCN_UPDATEUI,
		Windows::SCN_MODIFIED,
		Windows::SCN_MACRORECORD,
		Windows::SCN_MARGINCLICK,
		Windows::SCN_NEEDSHOWN,
		Windows::SCN_PAINTED,
		Windows::SCN_USERLISTSELECTION,
		Windows::SCN_URIDROPPED,
		Windows::SCN_DWELLSTART,
		Windows::SCN_DWELLEND,
		Windows::SCN_ZOOM,
		Windows::SCN_HOTSPOTCLICK,
		Windows::SCN_HOTSPOTDOUBLECLICK,
		Windows::SCN_CALLTIPCLICK,
		Windows::SCN_AUTOCSELECTION,
		Windows::SCN_INDICATORCLICK,
		Windows::SCN_INDICATORRELEASE,
		Windows::SCN_AUTOCCANCELLED,
		Windows::SCN_AUTOCCHARDELETED

		args[:scn] = Windows::SCNotification.new(FFI::Pointer.new(args[:lParam]))
	end
end

Instance Method Details

#on(notification, &block) ⇒ Object



2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
# File 'lib/fzeet/windows/scintilla.rb', line 2378

def on(notification, &block)
	case c = Fzeet.constant(notification, *self.class::Prefix[:notification])
	when \
		Windows::SCEN_CHANGE,
		Windows::SCEN_SETFOCUS,
		Windows::SCEN_KILLFOCUS

		@parent.on(:command, @id, c, &block)
	else
		@parent.on(:notify, @id, c, &block)
	end

	self
end