Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
the.weavster
 
Posts: 135
Joined: Sat Mar 01, 2014 3:02 pm

ListIconGadget row height

by the.weavster Sat Oct 14, 2017 7:55 am

I'd like to be able to set the row height of a ListIconGadget to make it more finger friendly.


* edited because I noticed I'd missed the i in 'height' for the title *
Last edited by the.weavster on Mon Oct 16, 2017 4:52 pm, edited 1 time in total.
bbanelli
 
Posts: 96
Joined: Mon Jul 13, 2015 7:40 am

Re: ListIconGadget row heght

by bbanelli Sun Oct 15, 2017 8:41 pm

Very appealing request!

+1
"If you lie to the compiler, it will get its revenge."
Henry Spencer
http://www.pci-z.com/
User avatar
Peter
 
Posts: 486
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: ListIconGadget row heght

by Peter Mon Oct 16, 2017 8:18 am

how about to increase the font-size?
Code: Select all
LoadFont(0, "Arial", 24)
OpenWindow(0, #PB_Ignore, #PB_Ignore, 800, 800, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 0, 0, 800, 800, "Name", 300, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 400)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 SpiderBasic Road, BigTown, CodeCity")
SetGadgetFont(0, FontID(0))


nevertheless here's a snippet to set the row height:
Code: Select all
Macro GetGadgetID(Gadget)
   If IsGadget(Gadget) = 0 : ProcedureReturn : EndIf
   If GadgetType(Gadget) <> #PB_GadgetType_ListIcon : ProcedureReturn : EndIf
   Protected GadgetID = GadgetID(Gadget)
EndMacro

Procedure SetRowHeight(Gadget, RowHeight)
   
   GetGadgetID(Gadget)
   
   ! var grid = v_gadgetid.gadget;
   ! spider.DojoAspect.after( grid, 'renderRow', function( row, args ) {
   !  $(row).css('height', v_rowheight + 'px');
   !  return row;
   ! });   
   
EndProcedure

OpenWindow(0, #PB_Ignore, #PB_Ignore, 800, 800, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 0, 0, 800, 800, "Name", 300, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 400)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 SpiderBasic Road, BigTown, CodeCity")

SetRowHeight(0, 36)


Greetings ... Peter
IdeasVacuum
 
Posts: 135
Joined: Tue Feb 25, 2014 1:27 pm

Re: ListIconGadget row heght

by IdeasVacuum Mon Oct 16, 2017 10:31 am

That is a good solution Peter, thankyou! (not the bigger font one, that requires wider rows). :D
the.weavster
 
Posts: 135
Joined: Sat Mar 01, 2014 3:02 pm

Re: ListIconGadget row height

by the.weavster Mon Oct 16, 2017 4:53 pm

@Peter

Thank you :D
Return to Feature Requests and Wishlists

Who is online

Users browsing this forum: No registered users and 1 guest