Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

First post - Three questions - Borland 6 C++ Builder

Hi all - Nice to find a Builder site with some throughput - its been a while for me - used to frequent BytemanC forum ( gone now ).

Just finishing off a project, a few loose ends to be sorted out.
------------------
1. With TStringGrid, is there any way to control the 'justification' or 'padding' within a cell. Example - a 10*10 grid, each displaying a single letter (crossword style). At the moment the letter appears at the left edge of the cell.
I have options of altering cell size/ font/ or puting a space in front of each letter - but these are not ideal.
------------------
2.I use the following to activate and point a user online to a web site:

void __fastcall TSubmissionForm::OnlineClick(TObject *Sender)
{
const char* action = "open";
const char* browser = "iexplore";
ShellExecute(NULL,action, browser,"http://www.bla/bla...bla/sub1.htm" , NULL, SW_SHOWNORMAL);
}

Ideally I want it to open the users 'default' browser as opposed to a specific one. Any ideas?
-------------------

3. In one application I use a TStringGrid, with a fixed number of rows dislayed, and with the vertical scroll bar enabled. What I would like to do is set it so that after each refresh ( the data is cleared and then replaced with new data ) no matter how many rows will be needed or on which row the last user clicked - the focus always starts at row 1.( IE the scroll bar starts at the top) Is this done programatically or are there any preset properties/methods for this?
------------------

Kind regards
AdaPlusPLus

Comments

  • bilderbikkelbilderbikkel Member Posts: 754
    : Ideally I want it to open the users 'default' browser as opposed to a specific one. Any ideas?

    Perhaps it can be found in the CppWebBrowser Component, to be found under the Internet tab of the Component Palette.

    Otherwise, I'm pretty sure it can be found in the Registry (see
    http://www.codepedia.com/1/CppBuilderTRegistryIniFile for more links)

    Use /myWinDir/RegEdit.exe to browse the Registry.

    Using it is easy:

    [code]
    #include //std::auto_ptr
    #include //TRegIniFile

    const std::auto_ptr registry(new TRegIniFile("myAppName"));
    registry->WriteString("chapter","key","Today is a good day to go the pub.");
    const String wisdom = registry->readString("chapter","key","defaultValueWhenNotFound");
    [/code]

    Good luck,
    bilderbikkel

  • bilderbikkelbilderbikkel Member Posts: 754
    : 3. In one application I use a TStringGrid, with a fixed number of rows dislayed, and with the vertical scroll bar enabled. What I would like to do is set it so that after each refresh ( the data is cleared and then replaced with new data ) no matter how many rows will be needed or on which row the last user clicked - the focus always starts at row 1.( IE the scroll bar starts at the top) Is this done programatically or are there any preset properties/methods for this?

    The trick is easy if you know it:

    [code]
    StringGrid1->Row = 1;
    [/code]

    Good luck,
    bilderbikkel

  • AdaPlusPlusAdaPlusPlus Member Posts: 4
    : : 3. In one application I use a TStringGrid, with a fixed number of rows dislayed, and with the vertical scroll bar enabled. What I would like to do is set it so that after each refresh ( the data is cleared and then replaced with new data ) no matter how many rows will be needed or on which row the last user clicked - the focus always starts at row 1.( IE the scroll bar starts at the top) Is this done programatically or are there any preset properties/methods for this?
    :
    : The trick is easy if you know it:
    :
    : [code]
    : StringGrid1->Row = 1;
    : [/code]
    :
    : Good luck,
    : bilderbikkel
    :
    :
    Thanks bilderbikkel for both replies - you seem to be kept very busy answering questions on this forum. You da man! Thanks :)
  • bilderbikkelbilderbikkel Member Posts: 754
    It is great to answer people with good questions. I wish I could've answered the first as well...

    See ya,
    bilderbikkel

  • AdaPlusPlusAdaPlusPlus Member Posts: 4
    [b][red]This message was edited by AdaPlusPlus at 2005-10-5 1:33:13[/red][/b][hr]
    [b][red]This message was edited by AdaPlusPlus at 2005-10-5 1:32:32[/red][/b][hr]
    [b][red]This message was edited by AdaPlusPlus at 2005-10-5 1:31:54[/red][/b][hr]
    FOR THOSE WHO MIGHT WANT TO KNOW THE ANSWER TO MY No3 QUESTION:

    The best solution Ive found so far to always opening the 'Default' browser from within your C++ app is: ShellExecute().

    In this form:-

    ShellExecute(NULL, "open", "target url", NULL, NULL, SW_SHOWNORMAL);

    When called, this function always appears to open the target url using the systems default browser. Simple :)

    Tested with IE and Firefox

    Regards
    AdaPlusPlus






Sign In or Register to comment.