Advertisement
overloop

pure c wysiwyg winapi gui 1% done

Apr 3rd, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.86 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4.     <title>title</title>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.     <meta name="description" content="" />
  7.     <meta name="keywords" content="" />
  8.     <meta name="robots" content="index,follow" />
  9.     <!-- <link rel="stylesheet" type="text/css" href="styles.css" /> -->
  10.     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  11.    
  12. <script type="text/javascript">
  13.  
  14. var num = 0;
  15.  
  16.  
  17.  
  18. function form_select(name,options) {
  19.     var s = "";
  20.     for (var i=0;i<options.length;i++) {
  21.         s = s + '<option selected="selected">' + options[i] + '</option>';
  22.     }
  23.     return '<select name="' + name + '">' + s + '</select>';
  24. }
  25.  
  26. function form_text(name,value,size) {
  27.     return '<input type="text" name="' + name + '" value="' + value + '" size="' + size + '"/>';
  28. }
  29.  
  30. function form_checkbox(name,caption) {
  31.     return '<input type="checkbox" name="' + name + '" checked="checked" value="' + caption + '" />';
  32. }
  33.  
  34. function div_table(html) {
  35.     return '<table>' + html + '</table>';
  36. }
  37.  
  38. function table_tr(html,id) {
  39.     if (!id)
  40.         return '<tr>' + html + '</tr>';
  41.     else
  42.         return '<tr id="'+id+'">' + html + '</tr>';
  43. }
  44.  
  45. function tr_td(html) {
  46.     return '<td>' + html + '</td>';
  47. }
  48.  
  49. //type name id position anchors
  50. function widget(n) {
  51.     var types = ['form','button','edit','label'];
  52.     return table_tr(
  53.         tr_td(form_select('type'+n,types)) +
  54.         tr_td(form_text('name'+n,'',10)) +
  55.         tr_td(form_text('id'+n,'',10)) +
  56.        
  57.         tr_td(form_text('pos-x'+n,'0',3)) +
  58.         tr_td(form_text('pos-y'+n,'0',3)) +
  59.         tr_td(form_text('pos-w'+n,'0',3)) +
  60.         tr_td(form_text('pos-h'+n,'0',3)) +
  61.        
  62.         tr_td(form_checkbox('anc-l'+n,'l')) +
  63.         tr_td(form_checkbox('anc-t'+n,'t')) +
  64.         tr_td(form_checkbox('anc-r'+n,'r')) +
  65.         tr_td(form_checkbox('anc-b'+n,'b')) +
  66.        
  67.         '',
  68.         'r'+n
  69.         );
  70. }
  71.  
  72. function createWidget() {
  73.     var tr = $( widget(1) );
  74.     $("#properties-table").append( tr );
  75. }
  76.  
  77. $(document).ready( function() {
  78.     $("#properties-form").css("background-color",lightColor());
  79.     createWidget();
  80. });
  81.  
  82. function lightColor() {
  83.   function c() {
  84.     var d = 20;
  85.     return Math.floor(Math.random()*d+256-d).toString(16);
  86.   }
  87.   return "#"+c()+c()+c();
  88. }
  89.  
  90. </script>
  91.    
  92. <style type="text/css">
  93. #properties-form {
  94.     position: absolute;
  95.     width: 600px;
  96.     height: 400px;
  97.     bottom: 0;
  98.     right: 0;
  99. }
  100.  
  101. </style>
  102.    
  103. </head>
  104. <body>
  105.    
  106.     <table align="left" border="0" cellspacing="0" cellpadding="0" width="100%">
  107.    
  108. </table>
  109.  
  110.  
  111. <form id="properties-form">
  112.     <table id="properties-table">
  113.         <tr>
  114.             <!-- type name id position anchors -->
  115.         <th>widget</th><th>name</th><th>id</th><th colspan="4">position</th><th colspan="4">anchors</th>
  116.         </tr>
  117.     </table>
  118. </form>
  119.  
  120. </body>
  121. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement