Search found 149 matches

by GenRabbit
Wed Mar 26, 2025 12:06 am
Forum: Coding Questions
Topic: Paste to StringGadget
Replies: 5
Views: 274

Re: Paste to StringGadget

Code: Select all

		Case #WM_CHAR  
			If GetAsyncKeyState_(#VK_LCONTROL) & $8000 Or GetAsyncKeyState_(#VK_RCONTROL) & $8000
				ProcedureReturn DefSubclassProc_(hWnd, uMsg, wParam, lParam)
			EndIf
Added this to the beginning, seems to have done the trick. :)
by GenRabbit
Tue Mar 25, 2025 11:59 pm
Forum: Coding Questions
Topic: Paste to StringGadget
Replies: 5
Views: 274

Re: Paste to StringGadget

Select uMsg
Case #WM_NCDESTROY
RemoveWindowSubclass_(hWnd, @NewSubclassWindow(), uIdSubclass)
Case #WM_PASTE
Debug "Working Now!"



Case #WM_CHAR
Debug "Char: " + FormatNumber(wparam,0,"","") ; #WM_PASTE gives value 22
SendMessage_(hwnd,#EM_GETSEL, @wp,@lp)
lt = lp - wp
Select ...
by GenRabbit
Tue Mar 25, 2025 12:20 am
Forum: Coding Questions
Topic: Paste to StringGadget
Replies: 5
Views: 274

Re: Paste to StringGadget

Rewrote your version to be more like mine.
And it still work
EnableExplicit
Global.i evWW

Import "Comctl32.lib"
; use the PureBasic Syntax (Windows API procedures using trailing underscore)
;
SetWindowSubclass_(hWnd.i, *fnSubclass, uIdSubclass.i, dwRefData.i) As "SetWindowSubclass ...
by GenRabbit
Mon Mar 24, 2025 11:01 pm
Forum: Coding Questions
Topic: Paste to StringGadget
Replies: 5
Views: 274

Paste to StringGadget

Hi
I have a problem, I try to intercept a Paste into a stringgadget, so to check that the stuff to be pasted does not include stuff not allowed(Numbers)

The intercept is happening inside and callback. So far so good.

The Question is, what command am I to intercept?

Tried #WM_PASTE, nothing ...
by GenRabbit
Fri Jan 24, 2025 12:20 am
Forum: Coding Questions
Topic: Listicongadget/RowSelect
Replies: 6
Views: 1331

Re: Listicongadget/RowSelect

Thanks. That shortened it a lot. :)
by GenRabbit
Thu Jan 23, 2025 11:52 pm
Forum: Coding Questions
Topic: Listicongadget/RowSelect
Replies: 6
Views: 1331

Listicongadget/RowSelect

Hi
is there a better way to detect row selected in listicongadget than this?

Code: Select all

	tv2 = CountGadgetItems(#ListIconGadget1)
	tv1 = 0
	While tv1 < tv2
		If GetGadgetItemState(#ListIconGadget1, tv1) & #PB_ListIcon_Selected
			Debug tv1
			Break
		EndIf
		tv1 +1	
	Wend	
by GenRabbit
Mon Jan 13, 2025 10:45 pm
Forum: Coding Questions
Topic: SetGadgetItemAttribute <- What Am I doing wrong
Replies: 2
Views: 2073

SetGadgetItemAttribute <- What Am I doing wrong

ListIconGadget(#ListIconGadget1, 20,340,400,240,"Month name",270,#PB_ListIcon_FullRowSelect)
AddGadgetColumn(#ListIconGadget1,2,"Days",100)
SetGadgetItemAttribute(#ListIconGadget1, 1 , #PB_ListIcon_ColumnAlignment, #PB_ListIcon_Center)

In my code i have these three lines of code. As I understand ...
by GenRabbit
Mon Jan 13, 2025 10:35 pm
Forum: Coding Questions
Topic: Block RightMouse Click on Stringagdget.
Replies: 8
Views: 5251

Re: Block RightMouse Click on Stringagdget.

Thanks, Hoped it could be done without using WINAPI, but TrackPopupMenu_ it is. The same one I used in my VB6 project I'm trying to transfer over. :D
by GenRabbit
Sun Jan 05, 2025 8:19 am
Forum: Coding Questions
Topic: Block RightMouse Click on Stringagdget.
Replies: 8
Views: 5251

Re: Block RightMouse Click on Stringagdget.

@Breeze4me: Thanks, that helped a lot.
I worked on it a little and run into a new problem.
I use dynamic menu, in other word destroy and rebuild each time.
Now when I choose an Item in the menu, is there a way to get what item from popupmenu is chosen?

If I use my old WINAPI code from my VB6 which ...
by GenRabbit
Sat Dec 07, 2024 4:40 am
Forum: Coding Questions
Topic: Block RightMouse Click on Stringagdget.
Replies: 8
Views: 5251

Re: Block RightMouse Click on Stringagdget.

Already done. But if someone either paste or hit a letter I get a message bubble poping up saying letters are not allowed. and the like.
by GenRabbit
Sat Dec 07, 2024 2:52 am
Forum: Coding Questions
Topic: Block RightMouse Click on Stringagdget.
Replies: 8
Views: 5251

Re: Block RightMouse Click on Stringagdget.

The ctrl+v/Win+v should be easier. As for banned text its everything which is not a number.
Banned is probably the wrong word here. Not allowed should be better. And numbers is the only thing allowed in the stringadgets.
by GenRabbit
Sat Dec 07, 2024 12:28 am
Forum: Coding Questions
Topic: Block RightMouse Click on Stringagdget.
Replies: 8
Views: 5251

Block RightMouse Click on Stringagdget.

I trying to intercept right click's on stringadgets and kill them of so the popupmenu do not appear if there is bad data in the Clipboard so they can't paste.

I'm checking it in an Callback if the mousepointer is over the gadgets and the code know when I'm over the gadget. tried to set uMsg to 0 ...
by GenRabbit
Fri Dec 06, 2024 9:50 pm
Forum: Coding Questions
Topic: Finding Selectionstart/selectionend in string/editorgadget
Replies: 4
Views: 788

Re: Finding Selectionstart/selectionend in string/editorgadget

I have done something more like this before. I just totally forgot that the wparam/lparam/sparam is mostly, if not always a pointer, and not the value itself.
by GenRabbit
Wed Dec 04, 2024 6:40 am
Forum: Coding Questions
Topic: Finding Selectionstart/selectionend in string/editorgadget
Replies: 4
Views: 788

Re: Finding Selectionstart/selectionend in string/editorgadget

Doh, So basically I have to use @ with every API call where it returns values like that. Point to the value, do not provide the value directly.
Thanks it did it. :)