Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[module] RaGrid 2.0.1.6-4


  • Please log in to reply
57 replies to this topic
majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
There is no way as far as I see.

The problem is that combobox fields keep indice as values, not text.

However, you could implement that yourself over existing control.
You basically need readonly TEXT column. When Enter hotkey is pressed and cursor is in that column, you will show AHK ComboBox on that location (GetCellRect). You can use ComboX module to simplify that task but you don't have to.


You could use USER column for the similar effect, but that may be harder.

Also, suggestion to author might be good way to go.
Posted Image

Toony Tom
  • Members
  • 4 posts
  • Last active: Feb 05 2010 08:51 AM
  • Joined: 21 Jan 2010
I'm also in need of read only text in RaGrid. After some searching I found where the Author of RaGrid replied to a request for this:
<!-- m -->http://www.asmcommun... ... ic=22171.0<!-- m -->
According to his reply you have to: "trap the GN_BEFOREEDIT and set the GRIDNOTIFY.fcancel to TRUE".

So far I've tried using a handler to catch "BeforeEdit" messages, as well as using LButton as a hotkey with RG_EndEdit(hCtrl,"","",1) after the user clicks but haven't had any luck so far. I have no clue what GRIDNOTIFY.fcancel is or if it's similar to bCancel in the endedit function. Could someone point out a way to use KetilO's (the author's) solution?

I appreciate the functions made for RaGrid, but, EndEdit does not seem to work at all for the purpose of blocking editing by the user, I don't really see how it's useful in any way.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

I appreciate the functions made for RaGrid, but, EndEdit does not seem to work at all for the purpose of blocking editing by the user, I don't really see how it's useful in any way.


Add
Result Return 1 to prevent action.



#SingleInstance, force
#NoEnv
SetBatchLines, -1

	w := 300, h := 400

	Gui, +LastFound +Resize
	hwnd := WinExist()
	
	hGrd := RG_Add(hwnd, 0, 0, w, h, "GRIDFRAME VGRIDLINES NOSEL", "OnRa" )
	RG_SetHdrHeight(hGrd, 25), RG_SetRowHeight(hGrd, 26)	

	RG_AddColumn(hGrd, "txt=Column 1",  "w=100", "hdral=1",	"txtal=1", "type=EditText")
	RG_AddColumn(hGrd, "txt=Column 2",  "w=100", "hdral=1",	"txtal=1", "type=EditText")
	
	loop, 100
		RG_AddRow(hGrd, 0, "Text" A_Index ,A_Index)
	Gui, Show, h%h% w%w%
return 

OnRa(HCtrl, Event, Col, Row, Data="") {
	if (Event = "BeforeEdit")
		return 1
}


#Include RaGrid.ahk

Posted Image

Toony Tom
  • Members
  • 4 posts
  • Last active: Feb 05 2010 08:51 AM
  • Joined: 21 Jan 2010
Ah, finally! What really helps me to learn is examples. Your manual is very concise and to the point. I missed that small piece of information in trying to learn how to use everything. I didn't mean that the endedit function WAS useless...just that i didn't see the use due to my lack of understanding in stopping the editing to begin with. Sorry for sounding harsh there. Thank you for your example. Perhaps having more examples in the manual would help others get a hold of using it when they're starting out.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
I will add examples in the manual once we have situations like this one that I find interesting for general usage.

ver 2.0.1.6-4

* Column have default width of 100 so "w" can now be omitted and column can be created just with RG_AddColumn(hGrd).
+ Examples group added in documentation. Added Read Only Grid example.
* Doc fixes.
Posted Image

Toony Tom
  • Members
  • 4 posts
  • Last active: Feb 05 2010 08:51 AM
  • Joined: 21 Jan 2010
:) Most excellent. This will come in handy for a database app I'm working on.

Nikla
  • Members
  • 20 posts
  • Last active: Jun 15 2010 07:31 AM
  • Joined: 16 Sep 2006
hi,
I would like to know if is possible to name a column in dinamic way,

maybe, like this?
RG_AddColumn(hGrd, "txt=%data%", "w=120", "hdral=1", "txtal=2", "type=EditLong", "format=#'###'###'###'###,##")

thank you very mutch
Nicola

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
See RG_SetHdrText

RG_SetHdrText(hGrd, 1, MyDynamicCol1Name)

Posted Image

Nikla
  • Members
  • 20 posts
  • Last active: Jun 15 2010 07:31 AM
  • Joined: 16 Sep 2006
Fantastik :D , it works :p

thank You very very mutch

See RG_SetHdrText

RG_SetHdrText(hGrd, 1, MyDynamicCol1Name)



wtg
  • Members
  • 251 posts
  • Last active: Dec 19 2012 03:54 PM
  • Joined: 04 Oct 2006
I just tried to use RaGrid with AHK_L, but it fails to operate correctly with it in a pretty interesting way: all the column headers and column values show only the first character of their values. Any idea how to correct this? Can this control be made to easily work with AHK_L?

wtg
  • Members
  • 251 posts
  • Last active: Dec 19 2012 03:54 PM
  • Joined: 04 Oct 2006
Nevermind... I see that you replied here.

Thanks again!

wtg
  • Members
  • 251 posts
  • Last active: Dec 19 2012 03:54 PM
  • Joined: 04 Oct 2006
To clarify... RaGrid works fine with AHK_L ANSI. It's the Unicode version of AHK_L that RaGrid doesn't work with.

rani
  • Members
  • 217 posts
  • Last active: Jul 21 2016 12:53 PM
  • Joined: 18 Mar 2008
raGrid

1. is it possible to define a column or more then one column
as column =freeze (or fixed) on horizontal scroll ?

2. is it possible to define tree nodes on first column ?
or make some .gif combination for that ?

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
1. No its not possible. Its possible using SpreedSheat control
2. ?
Posted Image

rani
  • Members
  • 217 posts
  • Last active: Jul 21 2016 12:53 PM
  • Joined: 18 Mar 2008
2?
treeview grid,
is very known in the grid industry,
as on first column you view node herarchy (+expand/collapse functions)

so ,
do raGRID support grid Treeview ?