Results 1 to 3 of 3

Thread: Center menu and searchbox to middle of logo

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Kungsbacka, Sweden
    Posts
    710

    Default Center menu and searchbox to middle of logo

    Hi!

    Enclosed are an image and code for what is beeing displayed.

    Is it possible to center the menu and "Sök artikel" (search) to some what center of the logo?
    Also i want to make the text a bit bigger on the "Meny" and "Logga in"

    Click image for larger version. 

Name:	Capture3.PNG 
Views:	102 
Size:	32.1 KB 
ID:	13487

    Code:
        Object oHeaderPanel is a cWebPanel
            Set piColumnCount to 24
            Set peRegion to prTop
    //        Set psCSSClass to "HeaderPanel"
            
            
            Object oMenuPanel is a cWebPanel
                Set peRegion to prLeft
                Set piColumnCount to 10
                Set piWidth to 1048
                Set piHeight to 120 
                Set psBackgroundColor to "white"
                
                Object oWebIFrame1 is a cWebImage
                    Set piColumnSpan to 3
                    Set psUrl to "./images/loggahead.png"
                    Set piHeight to 115
                End_Object
                
                Object oWebMenuBar1 is a cWebMenuBar
                    Set piColumnIndex to 3
                    Set piColumnSpan to 2
                    Set pbShowOnHover to True
                    Set psBackgroundColor to "white"
                    Set psCSSClass to ""
                    
                    Object oFileMenu is a cWebMenuItem
                        Set psCaption to "Meny"
                        Set psTextColor to "black"
                        Set psBackgroundColor to "white"
                            
                        Object oDashboard_itm is a cWebMenuItem
                            Set psCaption to "Favoritartiklar"
        
                            Procedure OnClick
                                Send NavigateBegin to oSelectProduct Self True
                            End_Procedure
        
                            Procedure OnGetNavigateForwardData tWebNavigateData  ByRef NavigateData Handle hoToView
                                Forward Send OnGetNavigateForwardData (&NavigateData) hoToView
                            
                                Get NamedValueAdd NavigateData.NamedValues "FavouriteArticle" "yes" to NavigateData.NamedValues
                            End_Procedure
        
                        End_Object
                            
                        Object oMyOrders is a cWebMenuItem
                            Set psCaption to "Mina ordrar"
    
    
                            Procedure OnClick
                                Forward Send OnClick
                                Send NavigateBegin to oCustomerOrders Self True
                            End_Procedure
                        End_Object
    
    
                        Object oAboutTrendTex is a cWebMenuItem
                            Set psCaption to "Kontakta TrendTex"
                        
                            Procedure OnClick
                                Forward Send OnClick
                                Send NavigateToPage "http://www.trendtex.se/Kontaktinfo.html" btNewTab
                            End_Procedure
                        End_Object
                    
    
    
                        Object oSignOut_itm is a cWebMenuItem
                            Set psCaption to "Logga ut"
    
    
                            Procedure OnClick
                                If (IsLoggedIn(ghoWebSessionManager)) Begin
                                    Send RequestLogout of ghoWebSessionManager
                                    WebSet pbRender of (oLoginMenuItem(oWebMenuBar1(oMenuPanel(oHeaderPanel)))) to True
                                    
                                    Send ShowInfoBox "Du är nu utloggad.\n\rTack för besöket, välkommen åter" "Logga ut"
                                End
                                Else Begin
                                    Send RequestLogin of ghoWebSessionManager
                                End
                            End_Procedure
                        End_Object
    
    
                    End_Object 
    
    
                    Object oLoginMenuItem is a cWebMenuItem
                        Set psTextColor to "black"
                        Set psBackgroundColor to "white"
    
    
                        Set psCaption to "Logga in"
            
                        Procedure OnClick
                            Send RequestLogin to ghoWebSessionManager
                        End_Procedure
                    End_Object
    
    
                    
                    
                End_Object
                
                Object oGlobalSearchArticles is a cWebForm
                    Set piColumnIndex to 5
                    Set psPlaceHolder to "Sök artikel"
                    Set pbShowLabel to False
                    Set piColumnSpan to 4
                    Set psCSSClass to "SearchBox"
            
                    WebPublishProcedure DoEnter
                            
                    Procedure DoEnter
                        Send NavigateBegin of oSelectProduct Self False
                    End_Procedure
                            
                    Procedure OnLoad
                        Forward Send OnLoad
                        Send AddKeyHandler (RefProc(DoEnter)) 13 False False False
                    End_Procedure
            
                    Procedure OnGetNavigateForwardData tWebNavigateData  ByRef NavigateData Handle hoToView
                        String searchVal
                        WebGet psValue of Self to searchVal
                        WebSet psValue of Self to ""
            
                        If (searchVal ="") ;
                            Procedure_Return
                        Forward Send OnGetNavigateForwardData (&NavigateData) hoToView
                        Get NamedValueAdd NavigateData.NamedValues "SearchFor" (ToANSI(searchVal))  to NavigateData.NamedValues                    
                    End_Procedure
                End_Object
            End_Object
    
    
            Object oCaptionPanel is a cWebPanel
                Set peRegion to prCenter
            End_Object
    
    
            
            Object oActionPanel is a cWebPanel
                Set peRegion to prRight
                Set piColumnCount to 5
                Set piWidth to 300   
    
    
                Object oCartLabel is a cWebLabel
                    Set psLabel to "Varukorg"
                    Set pbShowLabel to True
                    Set psLabelColor to "black"
                    Set piColumnIndex to 1
                    Set piLabelOffset to 0
                End_Object
    
    
                // ToDo: Skall ej visas om man inte är inloggad
                // ToDo: Om det inte finns ett ordernr ska man inte heller kunna visa kundkorg och den ska vara 
                // ToDo: Rendera vid start också
                Object oCart is a cWebHtmlBox
                    Set piColumnIndex to 2
                    Set piColumnSpan to 0
                    Set psHtml to '<div id="ex4"><span Class="p1 fa-stack fa-2x has-badge" data-count="0" data-ServerOnClick="1" data-OnClickParam="1"><i Class="p3 fa fa-shopping-cart fa-stack-1x xfa-inverse" data-count="4b"></i></span></div>'
                    Set pbServerOnClick to True
                    
                    Procedure RerenderBasket Integer count
                        String htmlTemplate html
                        Move '<div id="ex4"><span Class="p1 fa-stack fa-2x has-badge" data-count="%1" data-ServerOnClick="1" data-OnClickParam="1"><i Class="p3 fa fa-shopping-cart fa-stack-1x xfa-inverse" data-count="4b"></i></span></div>' to htmlTemplate 
                        
                        Move (SFormat(htmlTemplate, count)) to html 
                        Send UpdateHtml html
                    End_Procedure
    
    
                    Procedure OnClick String sId String sParam
                        Forward Send OnClick sId sParam
                        
                        Send NavigateForward to oCurrentOrder Self                     
                    End_Procedure
                End_Object
    
    
            End_Object
    
    
            Object oBreadcrumbPanel is a cWebPanel
                Set peRegion to prBottom
                
                Object oHorizontalBreadcrumb is a cWebBreadcrumb
                    WebSetResponsive pbRender rmMobile to False
                End_Object         
            End_Object
    
    
        End_Object
    Martin Arvidsson, Data Martin i Kungsbacka AB

    I have six locks on my door all in a row. When I go out, I lock every other one. I figure no matter how long somebody stands there picking the locks, they are always locking three.

  2. #2
    Join Date
    Feb 2009
    Location
    South Florida
    Posts
    3,933

    Default Re: Center menu and searchbox to middle of logo

    i would probably try to set the menubar to the same height of the image object. verify that in the browser debugger and then use CSS to style the items so they center.
    hard to tell exactly without actually looking at the generated HTML but that would be my first guess/try
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  3. #3
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    2,415

    Default Re: Center menu and searchbox to middle of logo

    A simple hack would be to add two webspacer
    one at the top and other at the bottom of the controls.
    Both with fillheight set to true.

    This way your form controls will be vertically centered.
    But you may need to add them all to a webgroup
    Samuel Pizarro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •