226

(13 replies, posted in General)

I'm having the same problem.
I'm doing this in MVD and not Delphi.
Thank you

procedure Form1_Edit1onChange(Sender:TObject);
begin
       Form1.Edit2.Text:=ToWords(Form1.Edit1.value);
end;

When I enter 123 or 1234 in Edit1 I get
123:One hundred twenty three
1234:One thousand two hundred thirty four respectively

But what I was expecting to get is
123: One hundred and twenty three
1234: One thousand two hundred and thirty four respectively.


Click on link to get the British Format example
http://myvisualdatabase.com/forum/viewt … 225#p26225

228

(13 replies, posted in General)

Thanks jean.brezhonek
I tried using the above code earlier today before my post but did not work.
Error: Undeclared identity: 'Mouse'

229

(13 replies, posted in General)

Hello Dmitry,
I'm having a little challenge in making the popupMenu on a button appear on just a 'Left Click'.
The popupMenu only appears on 'Right Click'

How do I make this work on just a 'Left Click' on the button


procedure Form1_OnShow (Sender: string; Action: string);
var
  PopupMenu: TPopupMenu;
  MyItem: TMenuItem;
begin
  PopupMenu := TPopupMenu.Create(Form1);

  MyItem := TMenuItem.Create (PopupMenu);
  MyItem.Caption := 'Add';
  MyItem.OnClick := @popupMenuOnClick;
  PopupMenu.Items.Add(MyItem);

  MyItem := TMenuItem.Create (PopupMenu);
  MyItem.Caption := 'Edit';
  MyItem.OnClick := @popupMenuOnClick;
  PopupMenu.Items.Add(MyItem);

  MyItem := TMenuItem.Create (PopupMenu);
  MyItem.Caption := 'Delete';
  MyItem.OnClick := @popupMenuOnClick;
  PopupMenu.Items.Add(MyItem);

  Form1.btnPopup.PopupMenu := PopupMenu;
end;

procedure popupMenuOnClick (Sender: string);
begin
  //
end;

begin
end.

Find the example project attached
Thank you.

230

(187 replies, posted in General)

Wow
MVD all the way
I really love this project.

231

(5 replies, posted in General)

Thank you Dmitry
I am really grateful.
MVD, the best Visual DBase App

It is perfect and simple.
http://thezimguy.vacau.com/MVD/saveASnew.jpg

Dmitry used only two lines of code to do that. Excellent.

procedure frmEmployee_bSaveAsNew_OnClick (Sender: TObject; var Cancel: boolean);
begin
    frmEmployee.bSave.dbGeneralTableId:=-1;
    frmEmployee.bSave.Click;
end;

Download from the link provided by Dmitry above

Check other examples derek provided from link below
http://myvisualdatabase.com/forum/viewt … 146#p26146

232

(187 replies, posted in General)

Hi Dmitry,
FEATURE REQUEST
Please would it be possible to add "Copy Row As New Record" to the button actions in the next release?

http://thezimguy.vacau.com/copyASnew.jpg
Thank you.

233

(5 replies, posted in General)

Hello Dmitry and MVD friends
Please can this feature be implemented?
http://thezimguy.vacau.com/copyASnew.jpg

I wish the next update will have the 'Copy As New Record' added to the Action for the button.

Please how do I implement this manually using a button.

When I click on the 'COPY AS NEW', it should copy the selected row as a new record which I can edit before saving.
Thank you.

234

(9 replies, posted in Script)

SIMPLIFIED MENU CREATION
You can also follow this post to create your menus with ease using functions and procedures

http://myvisualdatabase.com/forum/viewtopic.php?id=4463

235

(187 replies, posted in General)

FEATURE REQUEST

User double click a component.
The user is taken to the script page where the component event is written
User should be able to switch between events so that user can type his code

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQnYRIn0KBDlzNW10DKrpy72dNWec7_TyfW-Q8VZ27QmBbLU18j


The following also come in handy
1. Menu Control
2. Timer Control
3. Status Bar Control

Thank you

236

(8 replies, posted in General)

Wow
You are great Dmitry
You have really made things easy for database system making

It worked perfectly. My dynamic menu is fully ready with submenus and images.
Thanks

I LOVE MVD

237

(8 replies, posted in General)

There is no problem with creating the Menu items from a function or procedure.
THE NEW TOPIC IS HOW TO ADD A DYNAMIC OnClick Event to the procedure from a string


var 
   MainMenu1 : TMenuItem;

Procedure CreateMenuItem (Const  Menu : TMenuItem ; Caption : String; DynamicEvent );
var MenuItem : TMenuItem;
Begin
    MenuItem := TMenuItem.Create(Form1.Menu);
    MenuItem.Caption := Caption;
    MenuItem.OnClick := @DynamicEvent; /////////////////I want to add dynamic event here from string
    Form1.Menu.Items.Add(MenuItem);
End;

procedure Form1_OnShow (Sender: string; Action: string); // event OnShow
Begin
        CreateMenuItem(MainMenu1,'Users');//Create mainMenu
End;

begin

end.

Eg. if I call the procedure

CreateMenuItem(MainMenu1,'Users',Event1_onClick);

i want it to create

  • a menu item 'Users'

  • an onClick event on Event1_onClick

238

(8 replies, posted in General)

Solved

This is what I was looking for

var 
   MainMenu1 : TMenuItem;

Procedure CreateMenuItem (Const  Menu : TMenuItem ; Caption : String );
var MenuItem : TMenuItem;
Begin
    MenuItem := TMenuItem.Create(Form1.Menu);
    MenuItem.Caption := Caption;
    Form1.Menu.Items.Add(MenuItem);
End;

procedure Form1_OnShow (Sender: string; Action: string); // event OnShow
Begin
        CreateMenuItem(MainMenu1,'Files');//Create mainMenu
End;

begin

end.

239

(8 replies, posted in General)

Thanks jean.brezhonek
I have check the example but what I wanted was to create a function which I can call to create the menu.

I am able to create the menu as you have done but I want it to be simplified by using a function which I can call to create the menu.

Thank you once again

240

(8 replies, posted in General)

Solved

var 
    MainMenu1 : TMenuItem;
Procedure CreateMenuItem (Const  Menu : TMenuItem ; Caption : String );
var MenuItem : TMenuItem;
Begin
    MenuItem := TMenuItem.Create(Form1.Menu);
    MenuItem.Caption := Caption;
    Form1.Menu.Items.Add(MenuItem);
End;

procedure Form1_OnShow (Sender: string; Action: string); // event OnShow
Begin
        CreateMenuItem(MainMenu1,'Users');//Create mainMenu
        CreateMenuItem(MainMenu1,'Pages');//Create mainMenu
        CreateMenuItem(MainMenu1,'Reports');//Create mainMenu
End;

begin

end.

Thank you for your nice gesture. I really appreciate your work.
-----------------
I LUV MVD

http://myvisualdatabase.com/forum/viewtopic.php?id=4447

NB: MVD 4.6 beta version is required for this to work.
Check it out

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
    Form1.cbPages.ItemIndex:=4;////this will show the first 100 records
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    Form1.bSearch.Click;
end;

procedure Form1_bSearch_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbOffSet := 0;
end;             

procedure Form1_bNext_OnClick (Sender: TObject; var Cancel: boolean);
begin                                   
    Form1.GridEmployees.dbOffSet := Form1.GridEmployees.dbOffSet + StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbUpdate;
end;

procedure Form1_bPrev_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form1.GridEmployees.dbOffSet := Form1.GridEmployees.dbOffSet - StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    if Form1.GridEmployees.dbOffSet < 0 then Form1.GridEmployees.dbOffSet := 0;
    Form1.GridEmployees.dbUpdate;
end;

procedure Form1_cbPages_OnChange(Sender: TObject; var Cancel: boolean);
begin
    if (Form1.cbPages.ItemIndex =0) then
    begin
        Form1.cbPages.ItemIndex := 1;
    end;
end;
begin
    //Form1.GridEmployees.dbLimit := 500;
end.

Download example here
http://myvisualdatabase.com/forum/viewtopic.php?id=4447

This is the preview

With the help of Dmitry
I have been able to add the pagination offset in a combo box so you can select the number of rows to display in the table Grid.
I'm really enjoying MVD.

Check this out

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
    Form1.cbPages.ItemIndex:=4;////this will show the first 100 records
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    Form1.bSearch.Click;
end;

procedure Form1_bSearch_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbOffSet := 0;
end;             

procedure Form1_bNext_OnClick (Sender: TObject; var Cancel: boolean);
begin                                   
    Form1.GridEmployees.dbOffSet := Form1.GridEmployees.dbOffSet + StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbUpdate;
end;

procedure Form1_bPrev_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form1.GridEmployees.dbOffSet := Form1.GridEmployees.dbOffSet - StrToInt((Form1.cbPages.Text));
    Form1.GridEmployees.dbLimit := StrToInt((Form1.cbPages.Text));
    if Form1.GridEmployees.dbOffSet < 0 then Form1.GridEmployees.dbOffSet := 0;
    Form1.GridEmployees.dbUpdate;
end;

procedure Form1_cbPages_OnChange(Sender: TObject; var Cancel: boolean);
begin
    if (Form1.cbPages.ItemIndex =0) then
    begin
        Form1.cbPages.ItemIndex := 1;
    end;
end;
begin
    //Form1.GridEmployees.dbLimit := 500;
end.

I really love MVD and wish this feature could be added.

FEATURE
User double click a component.
The user is taken to the script page where the component event is written
User should be able to switch between events so that user can type his code.


https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQnYRIn0KBDlzNW10DKrpy72dNWec7_TyfW-Q8VZ27QmBbLU18j


Please can you add Feature Request page to the forum where we can request and suggest features?
Thank you.
-----------------------------------------
thezimguy

Thank you so much boss
I'm really grateful
I will try it and communicate back

You are the best
Dmitry/MVD


It works like magic. You have really made it easy to load more data in the tablegrid

Guys check this new feature out. You will really love it

Don't forget to download the 4.6 beta] version Dmitry uploaded

Please how do I create pagination for tableGrid using buttons as next, previous, 1,2,3..., end etc
So that on form load. First 500 records will be loaded and when I click the next button the next 500 records will load without the first 500