Page 1 of 2

Borderless Frame? Howto

Posted: Wed Jun 10, 2009 4:26 pm
by ClueLess
How can I use a frame with no borders?

Thanks

Posted: Wed Jun 10, 2009 4:28 pm
by Trond
A frame is just a border. If you don't want it, don't use it.

Posted: Wed Jun 10, 2009 4:40 pm
by ClueLess
When you create a frame, the border is there

Posted: Wed Jun 10, 2009 4:43 pm
by ClueLess
sorry...
I need a frame to separate groups of radiobuttons

But don't want the user to see the frame border

Posted: Wed Jun 10, 2009 5:02 pm
by netmaestro
You mean just so they'll function as separate groups? You're using option gadgets, correct? If so, you could try this:

Code: Select all

If OpenWindow(0, 0, 0, 200, 110, "OptionGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    OptionGadget(0, 10, 20, 60, 20, "Option 1")
    OptionGadget(1, 10, 45, 60, 20, "Option 2")
    OptionGadget(2, 10, 70, 60, 20, "Option 3")
    
    ButtonGadget(3,0,0,1,1,""):FreeGadget(3) ; There is no "CloseGroup" command, so trick PB into starting a new group
    
    OptionGadget(3, 90, 20, 60, 20, "Option A")
    OptionGadget(4, 90, 45, 60, 20, "Option B")
    OptionGadget(5, 90, 70, 60, 20, "Option C")    
    
    SetGadgetState(1, 1)   ; set second option as active one
    SetGadgetState(3, 1)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

Posted: Wed Jun 10, 2009 5:41 pm
by SCRJ
Use the ContainerGadget to group the OptionGadgets.

Posted: Tue Jun 16, 2009 8:09 am
by ClueLess
That was my first option, but the container but it hides the option gadgets

Posted: Tue Jun 16, 2009 9:19 am
by sirrab
ClueLess wrote:That was my first option, but the container but it hides the option gadgets
are you creating the container after the options?

you need to create the container before the options gadgets

Posted: Tue Jun 16, 2009 11:20 am
by ClueLess
I'm not an expert but I know that

Posted: Tue Jun 16, 2009 12:15 pm
by sirrab
ClueLess wrote:I'm not an expert but I know that
sorry just trying to help

Posted: Tue Jun 16, 2009 1:04 pm
by Marlin

Code: Select all

If OpenWindow(0, 0, 0, 320, 550, "ContainerGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ContainerGadget(0, 5, 5, 310, 150, #PB_Container_BorderLess)
    OptionGadget(1, 10, 20, 100, 20, "Option 1")
    OptionGadget(2, 10, 45, 100, 20, "Option 2")
    OptionGadget(3, 10, 70, 100, 20, "Option 3")
  CloseGadgetList()
  ContainerGadget(4, 5, 160, 310, 150, #PB_Container_BorderLess)
    OptionGadget(5, 10, 20, 100, 20, "Option A")
    OptionGadget(6, 10, 45, 100, 20, "Option B")
    OptionGadget(7, 10, 70, 100, 20, "Option C")
  CloseGadgetList()
  ContainerGadget(8, 5, 320, 310, 150, #PB_Container_BorderLess)
    OptionGadget(9, 10, 20, 100, 20, "Option X")
    OptionGadget(10, 10, 45, 100, 20, "Option Y")
    OptionGadget(11, 10, 70, 100, 20, "Option Z")
  CloseGadgetList()
  
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
This seems to work for me.

Would it work for you, ClueLess?

Posted: Wed Jun 17, 2009 8:21 am
by ClueLess
it does work for me too. That was exactely how I was doing. and didn't work. I wll put it in the code and see how this goes this time

Posted: Wed Jun 17, 2009 8:29 am
by ClueLess
Did not work in the application code. Here is the code:

Code: Select all

Procedure Open_EmploiesWindow(action.s)
	If OpenWindow(#Emploies_Window, 384, 91, 513, 490, "Detalhe de Empregado", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
		ButtonGadget(#Cmd_Emploie_OK, 265, 435, 100, 30, "Adicionar")
		ButtonGadget(#Cmd_Emploie_Erase, 20, 435, 100, 30, "Limpar")
		ButtonGadget(#Cmd_Delete, 265, 435, 100, 30, "Remover")
		ButtonGadget(#Cmd_Update, 265, 435, 100, 30, "Actualizar")
		ButtonGadget(#Cmd_Emploie_Cancel, 385, 435, 100, 30, "Cancelar")
		PanelGadget(#Pnl_Emploies, 20, 20, 465, 395)
			
			AddGadgetItem(#Pnl_Emploies, -1, "Informação")
			TextGadget(#Lbl_Emploie_Name, 25, 20, 410, 20, "Nome")
			StringGadget(#Txt_Emploie_Name, 25, 40, 410, 25, "")
			TextGadget(#Lbl_Emploie_aniversary, 25, 90, 90, 20, "Data de Nasc.")
			StringGadget(#Txt_Emploie_Aniversary, 25, 110, 90, 25, "")
			TextGadget(#Lbl_Emploie_Home, 135, 90, 95, 20, "Naturalidade")
			StringGadget(#Txt_Emploie_Home, 135, 110, 140, 25, "")
			TextGadget(#Lbl_Emploie_State, 295, 90, 115, 20, "Provincia")
			StringGadget(#Txt_Emploie_State, 295, 110, 140, 25, "")
			TextGadget(#Lbl_Emploie_Address_1, 25, 160, 410, 20, "Morada")
			StringGadget(#Txt_Emploie_Address_1, 25, 180, 410, 25, "")
			TextGadget(#Lbl_Emploie_Address_2, 25, 230, 195, 20, "Bairro")
			StringGadget(#Txt_Emploie_Address_2, 25, 250, 195, 25, "")
			TextGadget(#Lbl_Emploie_Address_City, 240, 230, 195, 20, "Cidade")
			StringGadget(#Txt_Emploie_Address_City, 240, 250, 195, 25, "")
			TextGadget(#Lbl_Emploie_Phone, 25, 300, 140, 20, "Telefone")
			StringGadget(#Txt_Emploie_Phone, 25, 320, 140, 25, "")
			TextGadget(#Lbl_Emploie_Email, 185, 300, 250, 20, "E-Mail")
			StringGadget(#Txt_Emploie_Email, 185, 320, 250, 25, "")
			
			AddGadgetItem(#Pnl_Emploies, -1, "Documentos")
			TextGadget(#Lbl_EmploieBI, 25, 20, 150, 20, "Nº do BI")
			StringGadget(#Txt_Emploie_BI, 25, 40, 150, 25, "")
			TextGadget(#Lbl_Emploie_BI_Local, 195, 20, 130, 20, "Emitido Em")
			StringGadget(#Txt_Emploie_BI_Local, 195, 40, 130, 25, "")
			TextGadget(#Lbl_Emploie_BI_Date, 345, 20, 90, 20, "Data")
			StringGadget(#Txt_Emploie_BI_Date, 345, 40, 90, 25, "")
			TextGadget(#Lbl_Emploie_SS_Number, 25, 90, 150, 20, "Nº da Segurança Social")
			StringGadget(#Txt_Emploie_SS_Number, 25, 110, 195, 25, "")
			TextGadget(#Lbl_Emploie_fiscal_Number, 240, 90, 150, 20, "Nº de Contribuinte")
			StringGadget(#Txt_Emploie_Fiscal_Number, 240, 110, 195, 25, "")
			
			AddGadgetItem(#Pnl_Emploies, -1, "Admissão")
			TextGadget(#Lbl_Emploie_code, 25, 20, 85, 20, "Código")
			StringGadget(#Txt_Emploie_Code, 25, 40, 85, 25, "")
			TextGadget(#Lbl_Emploie_Date, 130, 20, 90, 20, "Admissão")
			StringGadget(#Txt_Emploie_Date, 130, 40, 90, 25, "")
			TextGadget(#Lbl_Emploie_Category, 240, 20, 195, 20, "Categoria Profissional")
			ComboBoxGadget(#Cbo_Emploie_Category, 240, 40, 195, 25)
			
			AddGadgetItem(#Pnl_Emploies, -1, "Salário")
			TextGadget(#Lbl_Salary, 20, 25, 120, 20, "Salario Base")
			StringGadget(#Txt_Salary, 20, 40, 175, 25, "")
			TextGadget(#Lbl_SalaryCurrency, 215, 25, 225, 20, "Moeda do Salário")
			ComboBoxGadget(#Cbo_SalaryCurrency, 215, 40, 225, 25)
			Frame3DGadget(#Frm_Alowances, 20, 80, 420, 170, "Subsidios")
			
;			Frame3DGadget(#Frm_Ctnr_Vacation, 30, 100, 400, 40, "")
  			ContainerGadget(#Frm_Ctnr_Vacation, 30, 100, 400, 40, #PB_Container_BorderLess) 
			OptionGadget(#Opt_Vacations_50, 40, 115, 170, 20, "Subsidio de Férias 50%")
			OptionGadget(#Opt_vacations_100, 250, 115, 175, 20, "Subsidio de Férias 100%")
			CloseGadgetList() 

;			Frame3DGadget(#Frm_ctnr_Christmas, 30, 130, 400, 40, "")
  			ContainerGadget(#Frm_ctnr_Christmas, 30, 130, 400, 40, #PB_Container_BorderLess) 
			OptionGadget(#Opt_Christmas_50, 40, 145, 170, 20, "Subsidio de Natal 50%")
			OptionGadget(#Opt_Christmas_100, 250, 145, 175, 20, "Subsidio de Natal 100%")
			CloseGadgetList() 
			
			CheckBoxGadget(#Chk_Travel, 40, 175, 170, 25, "Subsidio de Transportes")
			CheckBoxGadget(#Chk_Meal, 250, 175, 170, 25, "Subsidio de Refeição")
			CheckBoxGadget(#Chk_Productivity, 40, 210, 185, 25, "Subsidio de Productividade")
			CheckBoxGadget(#Chk_OverTime, 250, 210, 170, 25, "Horas Extraordinárias")
			Frame3DGadget(#Frm_Discounts, 20, 265, 420, 80, "Descontos")
			CheckBoxGadget(#Chk_Irt, 45, 305, 175, 25, "Rendimento de Trabalho")
			CheckBoxGadget(#Chk_SocialSecurity, 250, 305, 175, 25, "Segurança Social")
			ComboBoxGadget(#Cbo_SalaryCurrency, 215, 40, 225, 25)
		CloseGadgetList()
	EndIf
	FillEmploiesCategories()
	
	Select action
		Case "V"
			FillEmploieData()
			HideGadget(#Cmd_Emploie_OK, 1)
			HideGadget(#Cmd_Emploie_Erase, 1)
			HideGadget(#Cmd_Delete, 1)
			HideGadget(#Cmd_Update, 1)
			
		Case "U"
			FillEmploieData()
			HideGadget(#Cmd_Emploie_OK, 1)
			HideGadget(#Cmd_Emploie_Erase, 1)
			HideGadget(#Cmd_Delete, 1)
			HideGadget(#Cmd_Update, 0)
			
		Case "R"
			FillEmploieData()
			HideGadget(#Cmd_Emploie_OK, 1)
			HideGadget(#Cmd_Emploie_Erase, 1)
			HideGadget(#Cmd_Delete, 0)
			HideGadget(#Cmd_Update, 1)
			
		Case "A"
			HideGadget(#Cmd_Emploie_OK, 0)
			HideGadget(#Cmd_Emploie_Erase, 0)
			HideGadget(#Cmd_Delete, 1)
			HideGadget(#Cmd_Update, 1)
	EndSelect
EndProcedure

Posted: Wed Jun 17, 2009 9:07 am
by Marlin
The easiest way this could be wrong that I can think of at the moment
is something related to the creation of your constants.

Could you post that part of your code, so we can be shure of that aspect?

Posted: Wed Jun 17, 2009 9:15 am
by ClueLess

Code: Select all

	#Emploies_Window
	#Cmd_Emploie_OK
	#Cmd_Emploie_Erase
	#Cmd_Delete
	#Cmd_Update
	#Cmd_Emploie_Cancel
	#Pnl_Emploies
	#Lbl_Emploie_Name
	#Txt_Emploie_Name
	#Lbl_Emploie_Home
	#Txt_Emploie_Home
	#Lbl_Emploie_State
	#Txt_Emploie_State
	#Lbl_Emploie_Address_1
	#Txt_Emploie_Address_1
	#Lbl_Emploie_Address_2
	#Txt_Emploie_Address_2
	#Lbl_Emploie_Address_City
	#Txt_Emploie_Address_City
	#Lbl_Emploie_Phone
	#Txt_Emploie_Phone
	#Lbl_Emploie_Email
	#Txt_Emploie_Email
	#Lbl_EmploieBI
	#Txt_Emploie_BI
	#Lbl_Emploie_BI_Local
	#Txt_Emploie_BI_Local
	#Lbl_Emploie_BI_Date
	#Txt_Emploie_BI_Date
	#Lbl_Emploie_SS_Number
	#Txt_Emploie_SS_Number
	#Lbl_Emploie_fiscal_Number
	#Txt_Emploie_Fiscal_Number
	#Lbl_Emploie_code
	#Txt_Emploie_Code
	#Lbl_Emploie_Date
	#Txt_Emploie_Date
	#Lbl_Emploie_Category
	#Cbo_Emploie_Category
	#Lbl_Salary
	#Txt_Salary
	#Frm_Alowances
	#Frm_Ctnr_Vacation
	#Opt_Vacations_50
	#Opt_vacations_100
	#Frm_ctnr_Christmas
	#Opt_Christmas_50
	#Opt_Christmas_100
	#Chk_Travel
	#Chk_Meal
	#Chk_Productivity
	#Chk_OverTime
	#Frm_Discounts
	#Chk_Irt
	#Chk_SocialSecurity
	#Cbo_SalaryCurrency
	#Lbl_SalaryCurrency
	#Txt_Emploie_Aniversary
	#Lbl_Emploie_aniversary